OSDN Git Service

Makefile fixes
authorEric Andersen <andersen@codepoet.org>
Tue, 16 Jan 2001 13:11:36 +0000 (13:11 -0000)
committerEric Andersen <andersen@codepoet.org>
Tue, 16 Jan 2001 13:11:36 +0000 (13:11 -0000)
Makefile
libc/sysdeps/linux/arm/Makefile
libc/sysdeps/linux/common/syscalls.c
libc/sysdeps/linux/i386/Makefile
libc/sysdeps/linux/m68k/Makefile

index d2b37a1..f985e11 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,7 @@ done: libc.a $(DO_SHARED)
        @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
@@ -82,7 +82,7 @@ tags:
 
 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))
@@ -95,16 +95,31 @@ $(patsubst %, _dirclean_%, $(DIRS) test) : dummy
        $(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
 
index f9dba69..08e7c01 100644 (file)
@@ -37,17 +37,17 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 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 $@
index f426c3f..6a8f73e 100644 (file)
@@ -1005,8 +1005,10 @@ _syscall4(__ptr_t, mremap, __ptr_t, old_address, size_t, old_size, size_t,
 
 //#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
index a6b185c..9372560 100644 (file)
@@ -40,17 +40,17 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 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 $@
index 12c659a..1b5eb61 100644 (file)
@@ -39,17 +39,18 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
 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 $@