@echo
halfclean:
- @rm -f libc.a libuClibc.so.1 libcrt0.o
+ @rm -f libc.a libuClibc.so.1 crt0.o
headers: dummy
@rm -f include/asm include/linux include/bits
clean: subdirs_clean
@rm -rf tmp
- rm -f libc.a libcrt0.o
+ rm -f libc.a crt0.o libuClibc.so.1
rm -f include/asm include/linux include/bits
subdirs: $(patsubst %, _dir_%, $(DIRS))
$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
-install: libc.a
+install:
+ @if [ `id -u` -ne 0 ]; then \
+ echo "aborting install -- you are not root."; \
+ /bin/false; \
+ fi;
rm -f $(INSTALL_DIR)/include/asm
rm -f $(INSTALL_DIR)/include/linux
+ mkdir -p $(INSTALL_DIR)/include/bits
ln -s $(KERNEL_SOURCE)/include/asm $(INSTALL_DIR)/include/asm
ln -s $(KERNEL_SOURCE)/include/linux $(INSTALL_DIR)/include/linux
- mkdir -p $(INSTALL_DIR)/include/bits
find include/ -type f -depth -print | cpio -pdmu $(INSTALL_DIR)
find include/bits/ -depth -print | cpio -pdmu $(INSTALL_DIR)
+ rm -f $(INSTALL_DIR)/lib/libc.a
cp libc.a $(INSTALL_DIR)/lib
- if [ -f crt0.o ] ; then cp crt0.o $(INSTALL_DIR)/lib ; fi
+ chmod 644 $(INSTALL_DIR)/lib/libc.a
+ chown -R root.root $(INSTALL_DIR)/lib/libc.a
+ if [ -f crt0.o ] ; then \
+ rm -f $(INSTALL_DIR)/lib/crt0.o; \
+ cp crt0.o $(INSTALL_DIR)/lib ; \
+ chmod 644 $(INSTALL_DIR)/lib/crt0.o; \
+ chown -R root.root $(INSTALL_DIR)/lib/crt0.o; \
+ fi;
+ chmod -R 775 `find $(INSTALL_DIR)/include -type d`
+ chmod -R 644 `find $(INSTALL_DIR)/include -type f`
+ chown -R root.root $(INSTALL_DIR)/include
.PHONY: dummy
OBJS=$(SOBJS) $(MOBJ) $(COBJS)
-all: $(OBJS) $(CRT0_OBJ) $(LIBC)
+all: $(OBJS) $(LIBC)
-$(LIBC): ar-target
+$(LIBC): ar-target
-ar-target: $(OBJS)
+ar-target: $(OBJS) $(CRT0_OBJ)
$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+ cp $(CRT0_OBJ) $(TOPDIR)/$(CRT0_OBJ)
$(CRT0_OBJ): %.o : %.S
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
- cp $*.o $(TOPDIR)/libcrt0.o
$(SOBJS): %.o : %.S
$(CC) $(CFLAGS) -c $< -o $@
//#define __NR_query_module 167
#ifdef L_query_module
-_syscall5(int, query_module, const char *, name, int, which,
- void *, buf, size_t, bufsize, size_t*, ret);
+# ifdef __NR_query_module
+ _syscall5(int, query_module, const char *, name, int, which,
+ void *, buf, size_t, bufsize, size_t*, ret);
+# endif
#endif
//#define __NR_poll 168
OBJS=$(SOBJS) $(COBJS)
-all: $(OBJS) $(CRT0_OBJ) $(LIBC)
+all: $(OBJS) $(LIBC)
-$(LIBC): ar-target
+$(LIBC): ar-target
-ar-target: $(OBJS)
+ar-target: $(OBJS) $(CRT0_OBJ)
$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+ cp $(CRT0_OBJ) $(TOPDIR)/$(CRT0_OBJ)
$(CRT0_OBJ): %.o : %.S
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
- cp $*.o $(TOPDIR)/libcrt0.o
$(SOBJS): %.o : %.S
$(CC) $(CFLAGS) -c $< -o $@
OBJS=$(SOBJS) $(MOBJ) $(COBJS)
-all: $(OBJS) $(CRT0_OBJ) $(LIBC)
-$(LIBC): ar-target
+all: $(OBJS) $(LIBC)
-ar-target: $(OBJS)
+$(LIBC): ar-target
+
+ar-target: $(OBJS) $(CRT0_OBJ)
$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+ cp $(CRT0_OBJ) $(TOPDIR)/$(CRT0_OBJ)
$(CRT0_OBJ): %.o : %.S
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
- cp $*.o $(TOPDIR)/libcrt0.o
$(SOBJS): %.o : %.S
$(CC) $(CFLAGS) -c $< -o $@