summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile25
-rw-r--r--libc/sysdeps/linux/arm/Makefile8
-rw-r--r--libc/sysdeps/linux/common/syscalls.c6
-rw-r--r--libc/sysdeps/linux/i386/Makefile8
-rw-r--r--libc/sysdeps/linux/m68k/Makefile9
5 files changed, 37 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index d2b37a1f1..f985e116c 100644
--- 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
diff --git a/libc/sysdeps/linux/arm/Makefile b/libc/sysdeps/linux/arm/Makefile
index f9dba69c8..08e7c01b0 100644
--- a/libc/sysdeps/linux/arm/Makefile
+++ b/libc/sysdeps/linux/arm/Makefile
@@ -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 $@
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index f426c3f7f..6a8f73eb9 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -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
diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile
index a6b185c21..93725607c 100644
--- a/libc/sysdeps/linux/i386/Makefile
+++ b/libc/sysdeps/linux/i386/Makefile
@@ -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 $@
diff --git a/libc/sysdeps/linux/m68k/Makefile b/libc/sysdeps/linux/m68k/Makefile
index 12c659a07..1b5eb6195 100644
--- a/libc/sysdeps/linux/m68k/Makefile
+++ b/libc/sysdeps/linux/m68k/Makefile
@@ -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 $@