summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-10-07 16:27:57 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-10-07 16:27:57 +0000
commit8e87f7ffea28e5b1bc693a40e7d79e6e6509eee9 (patch)
tree576d5f56b44aff35e1ba982a6e99591471d09b9e
parent4583f84ac9ba043394be13c417e6fa0c82338c5f (diff)
Doing the compile in one step creates smaller archives, libcrypt.a shrinks from 12k to 10k, libutil.a to 8k to 4k. Use make provided features where possible /$</$^.
-rw-r--r--libcrypt/Makefile20
-rw-r--r--libutil/Makefile20
2 files changed, 18 insertions, 22 deletions
diff --git a/libcrypt/Makefile b/libcrypt/Makefile
index 2b129a8e2..86781e4c5 100644
--- a/libcrypt/Makefile
+++ b/libcrypt/Makefile
@@ -33,31 +33,29 @@ SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so
CSRC = $(wildcard *.c)
-OBJS=$(patsubst %.c,%.o, $(CSRC))
-
ifeq ($(strip $(HAVE_SHARED)),y)
all: $(SO_LIB_NAME)
else
all: $(AR_LIB_NAME)
endif
-$(AR_LIB_NAME): $(OBJS)
+$(AR_LIB_NAME): $(LIB_NAME).o
$(INSTALL) -d $(TOPDIR)lib
- $(RM) $(AR_LIB_NAME)
- $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS)
+ $(RM) $@
+ $(AR) $(ARFLAGS) $@ $<
$(SO_LIB_NAME): $(AR_LIB_NAME)
- $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $(SO_LIB_NAME)
+ $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $@
$(LD) $(LDFLAGS) -soname=$(LIB_NAME).so.$(MAJOR_VERSION) \
- -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $(AR_LIB_NAME) \
+ -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $< \
--no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \
-L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC)
$(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION)
- $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME)
+ $(LN) -sf $(SO_FULL_NAME) $@
-$(OBJS): %.o : %.c
- $(CC) $(CFLAGS) -c $< -o $@
- $(STRIPTOOL) -x -R .note -R .comment $*.o
+$(LIB_NAME).o: $(CSRC)
+ $(CC) $(CFLAGS) -o $@ -c $^
+ $(STRIPTOOL) -x -R .note -R .comment $@
clean:
$(RM) *.o *~ core
diff --git a/libutil/Makefile b/libutil/Makefile
index 6cd07e5e9..e825b2aba 100644
--- a/libutil/Makefile
+++ b/libutil/Makefile
@@ -36,31 +36,29 @@ ifneq ($(strip $(ARCH_HAS_MMU)),y)
CSRC := $(filter-out forkpty.c,$(CSRC))
endif
-OBJS=$(patsubst %.c,%.o, $(CSRC))
-
ifeq ($(strip $(HAVE_SHARED)),y)
all: $(SO_LIB_NAME)
else
all: $(AR_LIB_NAME)
endif
-$(AR_LIB_NAME): $(OBJS)
+$(AR_LIB_NAME): $(LIB_NAME).o
$(INSTALL) -d $(TOPDIR)lib
- $(RM) $(AR_LIB_NAME)
- $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS)
+ $(RM) $@
+ $(AR) $(ARFLAGS) $@ $<
$(SO_LIB_NAME): $(AR_LIB_NAME)
- $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $(SO_LIB_NAME)
+ $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) $@
$(LD) $(LDFLAGS) -soname=$(LIB_NAME).so.$(MAJOR_VERSION) \
- -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $(AR_LIB_NAME) \
+ -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive $< \
--no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \
-L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC)
$(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION)
- $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME)
+ $(LN) -sf $(SO_FULL_NAME) $@
-$(OBJS): %.o : %.c
- $(CC) $(CFLAGS) -c $< -o $@
- $(STRIPTOOL) -x -R .note -R .comment $*.o
+$(LIB_NAME).o: $(CSRC)
+ $(CC) $(CFLAGS) -o $@ -c $^
+ $(STRIPTOOL) -x -R .note -R .comment $@
clean:
$(RM) *.o *~ core