chiark / gitweb /
[PATCH] klibc: update v0.205
[elogind.git] / klibc / klibc / Makefile
index d01b2e43269b0c75ce7679bcf61637b7c3488eb8..a9aedc58f0440e0d68647a3c62c260f684116dae 100644 (file)
@@ -7,6 +7,8 @@
 # Include configuration rules
 include MCONFIG
 
+INCLUDE += -I./zlib
+
 TESTS   = $(patsubst %.c,%,$(wildcard tests/*.c)) \
          $(patsubst %.c,%.shared,$(wildcard tests/*.c))
 LIBOBJS = vsnprintf.o snprintf.o vsprintf.o sprintf.o \
@@ -47,10 +49,17 @@ LIBOBJS = vsnprintf.o snprintf.o vsprintf.o sprintf.o \
          inet/inet_ntoa.o inet/inet_aton.o inet/inet_addr.o \
          inet/inet_ntop.o inet/inet_pton.o inet/bindresvport.o \
          send.o recv.o
+
 ifeq ($(ERRLIST),1)
 LIBOBJS += errlist.o
 endif
 
+ifeq ($(ZLIB),1)
+LIBOBJS += zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/gzio.o \
+          zlib/uncompr.o zlib/deflate.o zlib/trees.o zlib/zutil.o \
+          zlib/inflate.o zlib/infback.o zlib/inftrees.o zlib/inffast.o
+endif
+
 SOLIB   = libc.so
 SOHASH  = klibc.so
 
@@ -59,7 +68,7 @@ LIB     = libc.a
 
 INTERP_O = interp.o
 
-all: tests $(CRT0) $(LIB) $(SOLIB) klibc.so
+all: tests $(CRT0) $(LIB) $(SOLIB) $(SOHASH) $(INTERP_O)
 
 # Add any architecture-specific rules
 include arch/$(ARCH)/Makefile.inc
@@ -79,12 +88,12 @@ tests/testvsnp.o : tests/testvsnp.c
 tests/% : tests/%.o $(LIB) $(CRT0)
        $(LD) $(LDFLAGS) -o $@ $(CRT0) $< $(LIB) $(LIBGCC)
        cp $@ $@.stripped
-       $(STRIP) $@.stripped
+       $(STRIPCMD) $@.stripped
 
 tests/%.shared : tests/%.o interp.o $(SOLIB)
        $(LD) $(LDFLAGS) -o $@ $(EMAIN) interp.o tests/$*.o -R $(SOLIB) $(LIBGCC)
        cp $@ $@.stripped
-       $(STRIP) $@.stripped
+       $(STRIPCMD) $@.stripped
 
 $(LIB): __static_init.o $(LIBOBJS) $(ARCHOBJS) syscalls/static.obj socketcalls/static.obj
        rm -f $(LIB)
@@ -168,6 +177,14 @@ spotless: clean
 bitsize:
        @echo $(BITSIZE)
 
+install: all
+       $(INSTALL_DATA) $(LIB) $(SOLIB) $(CRT0) $(INTERP_O) \
+               $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)lib
+       $(INSTALL_EXEC) klibc-`cat $(SOLIB).hash`.so \
+               $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)lib
+       $(INSTALL_EXEC) klibc-`cat $(SOLIB).hash`.so \
+               $(INSTALLROOT)/$(SHLIBDIR)
+
 ifneq ($(wildcard $(DIR).*.d),)
 include $(wildcard $(DIR).*.d)
 endif