diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2005-10-11 23:05:36 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2005-10-11 23:05:36 +0000 |
commit | 998913a5ce37f97c69be8ee7f57a3ad8478c8a80 (patch) | |
tree | 20768f292f19cfdc8f3767efa9cc62afe95b1dcd | |
parent | 99720814c3efa11dd1df59c4bd978e73b6f1ba18 (diff) | |
download | uClibc-alpine-998913a5ce37f97c69be8ee7f57a3ad8478c8a80.tar.bz2 uClibc-alpine-998913a5ce37f97c69be8ee7f57a3ad8478c8a80.tar.xz |
Do not defer expansions where useless, like CSRC/OBJS/LIB_NAME/AR_LIB_NAME, defer only for shared lib related stuff, because it is optional. Run STRIPTOOL only once. More use of /$^/$<.
-rw-r--r-- | ldso/ldso/Makefile | 25 | ||||
-rw-r--r-- | ldso/libdl/Makefile | 30 | ||||
-rw-r--r-- | libc/Makefile | 40 | ||||
-rw-r--r-- | libcrypt/Makefile | 7 | ||||
-rw-r--r-- | libintl/Makefile | 26 | ||||
-rw-r--r-- | libm/Makefile | 45 | ||||
-rw-r--r-- | libnsl/Makefile | 24 | ||||
-rw-r--r-- | libpthread/linuxthreads/Makefile | 49 | ||||
-rw-r--r-- | libpthread/linuxthreads_db/Makefile | 26 | ||||
-rw-r--r-- | libresolv/Makefile | 24 | ||||
-rw-r--r-- | librt/Makefile | 24 | ||||
-rw-r--r-- | libutil/Makefile | 7 |
12 files changed, 159 insertions, 168 deletions
diff --git a/ldso/ldso/Makefile b/ldso/ldso/Makefile index 2d7d867f9..cf5d07d57 100644 --- a/ldso/ldso/Makefile +++ b/ldso/ldso/Makefile @@ -67,34 +67,33 @@ ifneq ($(strip $(SUPPORT_LD_DEBUG)),y) LDFLAGS+=-s endif -LIB_NAME=ld-uClibc -SO_LIB_NAME=$(TOPDIR)lib/$(UCLIBC_LDSO) -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := ld-uClibc +SO_LIB_NAME := $(TOPDIR)lib/$(UCLIBC_LDSO) +SO_FULL_NAME := $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so -CSRC= ldso.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +CSRC := ldso.c +COBJS := $(patsubst %.c,%.o, $(CSRC)) -ASRC=$(wildcard $(TARGET_ARCH)/*.S) -AOBJS=$(patsubst %.S,%.o, $(ASRC)) +ASRC := $(wildcard $(TARGET_ARCH)/*.S) +AOBJS := $(patsubst %.S,%.o, $(ASRC)) -OBJS=$(AOBJS) $(COBJS) +OBJS := $(AOBJS) $(COBJS) all: $(SO_LIB_NAME) $(SO_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME) + $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ $(LD) $(LDFLAGS) -soname=$(UCLIBC_LDSO) \ - -o $(TOPDIR)lib/$(SO_FULL_NAME) $(OBJS) $(LIBGCC) - $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME) + -o $(TOPDIR)lib/$(SO_FULL_NAME) $^ $(LIBGCC) + $(LN) -sf $(SO_FULL_NAME) $@ $(COBJS): %.o : %.c $(CC) $(XXFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o $(AOBJS): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o clean: $(RM) *.o */*.o *~ core diff --git a/ldso/libdl/Makefile b/ldso/libdl/Makefile index 76149adbf..d31ce256d 100644 --- a/ldso/libdl/Makefile +++ b/ldso/libdl/Makefile @@ -45,14 +45,14 @@ ifeq ($(strip $(TARGET_ARCH)),mips) XXFLAGS := $(XXFLAGS:-O0=-O1) endif -LIB_NAME=libdl -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := libdl +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME := $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so -CSRC = libdl.c -OBJS = libdl.o -PIC_OBJS = libdl_pic.o +CSRC := libdl.c +OBJS := libdl.o +PIC_OBJS := libdl_pic.o # we do not get here, do we need a libdl.a, if ld.so is not ours? #ifeq ($(strip $(HAVE_SHARED)),y) @@ -63,24 +63,25 @@ all: $(AR_LIB_NAME) $(SO_LIB_NAME) $(AR_LIB_NAME): $(OBJS) ../ldso/$(TARGET_ARCH)/resolve.o $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) ../ldso/$(TARGET_ARCH)/resolve.o + $(RM) $@ + $(AR) $(ARFLAGS) $@ $^ shared_$(LIB_NAME).a: $(PIC_OBJS) - $(RM) shared_$(LIB_NAME).a - $(AR) $(ARFLAGS) shared_$(LIB_NAME).a $(PIC_OBJS) + $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ + $(AR) $(ARFLAGS) $@ $^ # this will be built only on the second round, when libc.so is present, # else we would link against libc.a $(SO_LIB_NAME): shared_$(LIB_NAME).a if [ -f $(TOPDIR)lib/libc.so ] ; then \ - $(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) -fini dl_cleanup --whole-archive shared_$(LIB_NAME).a \ + -o $(TOPDIR)lib/$(SO_FULL_NAME) -fini dl_cleanup --whole-archive $< \ --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \ -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(TOPDIR)lib/$(UCLIBC_LDSO) $(LIBGCC) ; \ $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME).$(MAJOR_VERSION) ; \ - $(LN) -sf $(SO_FULL_NAME) $(SO_LIB_NAME) ; \ + $(LN) -sf $(SO_FULL_NAME) $@ ; \ fi $(OBJS): %.o : %.c @@ -89,7 +90,6 @@ $(OBJS): %.o : %.c libdl_pic.o: libdl.c $(CC) $(XXFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o clean: $(RM) *.[oa] *~ core diff --git a/libc/Makefile b/libc/Makefile index c72d894ca..643d5f09e 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -38,10 +38,10 @@ VERSION_SCRIPT:=${shell if [ -f sysdeps/linux/$(TARGET_ARCH)/libc.map ] ; then \ echo "--version-script sysdeps/linux/$(TARGET_ARCH)/libc.map"; fi} # we have SHARED_MAJORNAME=libc.so.$(MAJOR_VERSION) defined in Rules.mak -LIB_NAME=libc -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=libuClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := libc +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = libuClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ifeq ($(strip $(HAVE_SHARED)),y) all: $(SO_LIB_NAME) @@ -61,31 +61,31 @@ endif # target is evaluated. That means if you run `rm obj.* ; make`, the wildcard # will evaluate to no files :(. shared_$(LIB_NAME).a: subdirs - $(RM) shared_$(LIB_NAME).a + $(RM) $@ objs=`cat obj.*` ; \ - $(AR) $(ARFLAGS) shared_$(LIB_NAME).a $$objs && \ - $(AR) dN 2 shared_$(LIB_NAME).a $$objs && \ - $(AR) dN 2 shared_$(LIB_NAME).a $$objs + $(AR) $(ARFLAGS) $@ $$objs && \ + $(AR) dN 2 $@ $$objs && \ + $(AR) dN 2 $@ $$objs @for objfile in obj.signal \ obj.string.generic obj.string.$(TARGET_ARCH) obj.string \ obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \ if [ -e $$objfile ] ; then \ if [ "$(MAKE_IS_SILENT)" = "n" ] ; then \ - echo $(AR) $(ARFLAGS) shared_$(LIB_NAME).a $$objfile ; \ + echo $(AR) $(ARFLAGS) $@ $$objfile ; \ fi ; \ objs=`cat $$objfile` ; \ fi ; \ - $(AR) $(ARFLAGS) shared_$(LIB_NAME).a $$objs || exit 1 ; \ + $(AR) $(ARFLAGS) $@ $$objs || exit 1 ; \ done $(AR_LIB_NAME): shared_$(LIB_NAME).a $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - cp shared_$(LIB_NAME).a $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) misc/internals/static.o `cat nonshared_obj.*` + $(RM) $@ + cp $< $@ + $(AR) $(ARFLAGS) $@ misc/internals/static.o `cat nonshared_obj.*` $(SO_LIB_NAME): $(AR_LIB_NAME) - $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(TOPDIR)lib/$(SHARED_MAJORNAME) $(SO_LIB_NAME) + $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(TOPDIR)lib/$(SHARED_MAJORNAME) $@ $(LD) $(LDFLAGS) $(VERSION_SCRIPT) -soname=$(SHARED_MAJORNAME) \ -o $(TOPDIR)lib/$(SO_FULL_NAME) --whole-archive shared_$(LIB_NAME).a \ --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \ @@ -93,15 +93,15 @@ $(SO_LIB_NAME): $(AR_LIB_NAME) $(LN) -sf $(SO_FULL_NAME) $(TOPDIR)lib/$(SHARED_MAJORNAME) $(RM) $(TOPDIR)lib/$(NONSHARED_LIBNAME) $(AR) $(ARFLAGS) $(TOPDIR)lib/$(NONSHARED_LIBNAME) `cat nonshared_obj.*` - echo "/* GNU ld script" > $(SO_LIB_NAME) - echo " * Use the shared library, but some functions are only in" >> $(SO_LIB_NAME) - echo " * the static library, so try that secondarily. */" >> $(SO_LIB_NAME) + echo "/* GNU ld script" > $@ + echo " * Use the shared library, but some functions are only in" >> $@ + echo " * the static library, so try that secondarily. */" >> $@ #OUT_FORMAT:=$(shell $(LD) --verbose | grep OUTPUT_FORMAT | awk -F '"' '{print $2}') - #echo "OUTPUT_FORMAT($(OUT_FORMAT))" >> $(SO_LIB_NAME) + #echo "OUTPUT_FORMAT($(OUT_FORMAT))" >> $@ ifeq ($(strip $(COMPAT_ATEXIT)),y) - echo "GROUP ( $(TOPDIR)lib/$(NONSHARED_LIBNAME) $(TOPDIR)lib/$(SHARED_MAJORNAME) )" >> $(SO_LIB_NAME) + echo "GROUP ( $(TOPDIR)lib/$(NONSHARED_LIBNAME) $(TOPDIR)lib/$(SHARED_MAJORNAME) )" >> $@ else - echo "GROUP ( $(TOPDIR)lib/$(SHARED_MAJORNAME) $(TOPDIR)lib/$(NONSHARED_LIBNAME) )" >> $(SO_LIB_NAME) + echo "GROUP ( $(TOPDIR)lib/$(SHARED_MAJORNAME) $(TOPDIR)lib/$(NONSHARED_LIBNAME) )" >> $@ endif tags: diff --git a/libcrypt/Makefile b/libcrypt/Makefile index 3b98690be..9a16b635b 100644 --- a/libcrypt/Makefile +++ b/libcrypt/Makefile @@ -28,8 +28,8 @@ CFLAGS+=$(SSP_ALL_CFLAGS) LIB_NAME := libcrypt AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME := $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so CSRC := $(wildcard *.c) @@ -47,6 +47,7 @@ endif $(AR_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ $(AR) $(ARFLAGS) $@ $^ $(SO_LIB_NAME): $(AR_LIB_NAME) @@ -60,11 +61,9 @@ $(SO_LIB_NAME): $(AR_LIB_NAME) $(LIB_NAME).o: $(CSRC) $(CC) $(CFLAGS) -o $@ -c $^ - $(STRIPTOOL) -x -R .note -R .comment $@ $(OBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o clean: $(RM) *.o *~ core diff --git a/libintl/Makefile b/libintl/Makefile index 86a6b8deb..09ccb36b2 100644 --- a/libintl/Makefile +++ b/libintl/Makefile @@ -26,17 +26,17 @@ include $(TOPDIR)Rules.mak CFLAGS+=$(SSP_ALL_CFLAGS) -LIB_NAME=libintl -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := libintl +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so -MSRC= intl.c -MOBJ= gettext.o ngettext.o dgettext.o dcgettext.o dngettext.o dcngettext.o \ +MSRC := intl.c +MOBJ := gettext.o ngettext.o dgettext.o dcgettext.o dngettext.o dcngettext.o \ textdomain.o bindtextdomain.o bind_textdomain_codeset.o \ _nl_expand_alias.o _nl_msg_cat_cntr.o # glibc-isms -OBJS=$(MOBJ) +OBJS := $(MOBJ) ifeq ($(strip $(HAVE_SHARED)),y) all: $(SO_LIB_NAME) @@ -46,21 +46,21 @@ endif $(AR_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) + $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ + $(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) $@ $(MOBJ): $(MSRC) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o clean: $(RM) *.o *~ core diff --git a/libm/Makefile b/libm/Makefile index ad080ecde..0d2aa57cd 100644 --- a/libm/Makefile +++ b/libm/Makefile @@ -38,15 +38,15 @@ CFLAGS+=$(SSP_ALL_CFLAGS) CFLAGS+=-D_IEEE_LIBM -D_ISOC99_SOURCE -D_SVID_SOURCE -LIB_NAME=libm -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := libm +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so -FL_MSRC = float_wrappers.c +FL_MSRC := float_wrappers.c ifeq ($(strip $(DO_C99_MATH)),y) -CSRC = e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c\ +CSRC := e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c\ e_exp.c e_fmod.c e_gamma.c e_gamma_r.c e_hypot.c e_j0.c\ e_j1.c e_jn.c e_lgamma.c e_lgamma_r.c e_log.c e_log10.c\ e_pow.c e_remainder.c e_rem_pio2.c e_scalb.c e_sinh.c\ @@ -61,7 +61,7 @@ CSRC = e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c\ w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c\ w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sinh.c\ w_sqrt.c fpmacros.c nan.c s_ceilf.c s_floorf.c -FL_MOBJ = acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \ +FL_MOBJ := acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \ ceilf.o copysignf.o cosf.o coshf.o erfcf.o erff.o exp2f.o expf.o \ expm1f.o fabsf.o fdimf.o floorf.o fmaf.o fmaxf.o fminf.o fmodf.o \ frexpf.o hypotf.o ilogbf.o ldexpf.o lgammaf.o log10f.o log1pf.o \ @@ -71,27 +71,27 @@ FL_MOBJ = acosf.o acoshf.o asinf.o asinhf.o atan2f.o atanf.o atanhf.o cbrtf.o \ tgammaf.o truncf.o else # This list of math functions was taken from POSIX/IEEE 1003.1b-1993 -CSRC = w_acos.c w_asin.c s_atan.c w_atan2.c s_ceil.c s_cos.c \ +CSRC := w_acos.c w_asin.c s_atan.c w_atan2.c s_ceil.c s_cos.c \ w_cosh.c w_exp.c s_fabs.c s_floor.c w_fmod.c s_frexp.c \ s_ldexp.c w_log.c w_log10.c s_modf.c w_pow.c s_sin.c \ - w_sinh.c w_sqrt.c s_tan.c s_tanh.c -CSRC+= s_expm1.c s_scalbn.c s_copysign.c e_acos.c e_asin.c e_atan2.c \ + w_sinh.c w_sqrt.c s_tan.c s_tanh.c \ + s_expm1.c s_scalbn.c s_copysign.c e_acos.c e_asin.c e_atan2.c \ k_cos.c e_cosh.c e_exp.c e_fmod.c e_log.c e_log10.c e_pow.c \ k_sin.c e_sinh.c e_sqrt.c k_tan.c e_rem_pio2.c k_rem_pio2.c \ s_finite.c # We'll add sqrtf to avoid problems with libstdc++ -FL_MOBJ = sqrtf.o +FL_MOBJ := sqrtf.o endif ifeq ($(strip $(HAS_FPU)),y) ifeq ($(strip $(DO_C99_MATH)),y) -ARCH_CSRC=$(wildcard $(TARGET_ARCH)/*.c) -ARCH_OBJS=$(patsubst %.c,%.o, $(ARCH_CSRC)) +ARCH_CSRC := $(wildcard $(TARGET_ARCH)/*.c) +ARCH_OBJS := $(patsubst %.c,%.o, $(ARCH_CSRC)) endif endif -COBJS=$(patsubst %.c,%.o, $(CSRC)) -OBJS=$(COBJS) $(FL_MOBJ) +COBJS := $(patsubst %.c,%.o, $(CSRC)) +OBJS := $(COBJS) $(FL_MOBJ) ifeq ($(strip $(HAVE_SHARED)),y) all: $(SO_LIB_NAME) @@ -101,26 +101,25 @@ endif $(AR_LIB_NAME): $(OBJS) $(ARCH_OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(ARCH_OBJS) + $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ + $(AR) $(ARFLAGS) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(ARCH_OBJS) $(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) $@ $(COBJS) $(ARCH_OBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o $(FL_MOBJ): $(FL_MSRC) $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o - $(STRIPTOOL) -x -R .note -R .comment $*.o tags: ctags -R diff --git a/libnsl/Makefile b/libnsl/Makefile index d20fe2113..45525c898 100644 --- a/libnsl/Makefile +++ b/libnsl/Makefile @@ -21,14 +21,14 @@ include $(TOPDIR)Rules.mak CFLAGS+=$(SSP_ALL_CFLAGS) -LIB_NAME=libnsl -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := libnsl +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so -CSRC = $(wildcard *.c) +CSRC := $(wildcard *.c) -OBJS=$(patsubst %.c,%.o, $(CSRC)) +OBJS := $(patsubst %.c,%.o, $(CSRC)) ifeq ($(strip $(HAVE_SHARED)),y) all: $(SO_LIB_NAME) @@ -38,21 +38,21 @@ endif $(AR_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) + $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ + $(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 clean: $(RM) *.o *~ core diff --git a/libpthread/linuxthreads/Makefile b/libpthread/linuxthreads/Makefile index d5637eccf..796cd60c3 100644 --- a/libpthread/linuxthreads/Makefile +++ b/libpthread/linuxthreads/Makefile @@ -28,28 +28,28 @@ CFLAGS :=$(CFLAGS:-O0=-O1) # Get the thread include dependencies CFLAGS += $(PTINC) -ARCH_CFLAGS = $(CFLAGS) +ARCH_CFLAGS := $(CFLAGS) ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) - SHARED_START_FILES = $(TOPDIR)lib/crti.o $(LIBGCC_DIR)crtbeginS.o - SHARED_END_FILES = $(LIBGCC_DIR)crtendS.o $(TOPDIR)lib/crtn.o +SHARED_START_FILES := $(TOPDIR)lib/crti.o $(LIBGCC_DIR)crtbeginS.o +SHARED_END_FILES := $(LIBGCC_DIR)crtendS.o $(TOPDIR)lib/crtn.o endif -LIB_NAME=libpthread -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := libpthread +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so -ARCH_CSRC=$(wildcard sysdeps/$(TARGET_ARCH)/*.c) -ARCH_OBJS=$(patsubst %.c,%.o, $(ARCH_CSRC)) +ARCH_CSRC := $(wildcard sysdeps/$(TARGET_ARCH)/*.c) +ARCH_OBJS := $(patsubst %.c,%.o, $(ARCH_CSRC)) -include sysdeps/$(TARGET_ARCH)/Makefile.in -CSRC = $(wildcard *.c) +CSRC = $(wildcard *.c) ifneq ($(strip $(UCLIBC_HAS_XLOCALE)),y) CSRC := $(filter-out locale.c,$(CSRC)) endif -OBJS=$(patsubst %.c,%.o, $(CSRC)) +OBJS := $(patsubst %.c,%.o, $(CSRC)) ifeq ($(strip $(HAVE_SHARED)),y) all: $(SO_LIB_NAME) @@ -59,34 +59,29 @@ endif $(AR_LIB_NAME): $(OBJS) $(ARCH_OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(ARCH_OBJS) + $(RM) $@ +ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) + $(STRIPTOOL) -X --strip-debug -R .note -R .comment $^ +else + $(STRIPTOOL) -x -R .note -R .comment $^ +endif + $(AR) $(ARFLAGS) $@ $(OBJS) + $(AR) $(ARFLAGS) $@ $(ARCH_OBJS) $(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_NOSTRIP) -soname=$(LIB_NAME).so.$(MAJOR_VERSION) \ - -o $(TOPDIR)lib/$(SO_FULL_NAME) $(SHARED_START_FILES) --whole-archive $(AR_LIB_NAME) \ + -o $(TOPDIR)lib/$(SO_FULL_NAME) $(SHARED_START_FILES) --whole-archive $< \ --no-whole-archive $(TOPDIR)libc/misc/internals/interp.o \ -L$(TOPDIR)lib -lc $(LDADD_LIBFLOAT) $(LIBGCC) $(SHARED_END_FILES) $(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 $@ -ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) - $(STRIPTOOL) -X --strip-debug -R .note -R .comment $*.o -else - $(STRIPTOOL) -x -R .note -R .comment $*.o -endif $(ARCH_OBJS): %.o : %.c $(CC) $(ARCH_CFLAGS) -c $< -o $@ -ifeq ($(strip $(PTHREADS_DEBUG_SUPPORT)),y) - $(STRIPTOOL) -X --strip-debug -R .note -R .comment $*.o -else - $(STRIPTOOL) -x -R .note -R .comment $*.o -endif clean: $(RM) *.o sysdeps/*/*.o *~ core diff --git a/libpthread/linuxthreads_db/Makefile b/libpthread/linuxthreads_db/Makefile index 3c7ee91a7..102b1becf 100644 --- a/libpthread/linuxthreads_db/Makefile +++ b/libpthread/linuxthreads_db/Makefile @@ -21,20 +21,20 @@ include $(TOPDIR)Rules.mak #CFLAGS+=$(SSP_ALL_CFLAGS) -LIB_NAME=libthread_db -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := libthread_db +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so # Get the thread include dependencies and shared object name CFLAGS += $(PTINC) -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\"" # Remove any -z defs since this lib will have undefined symbols -LDFLAGS := $(subst -z defs,,$(LDFLAGS)) --warn-unresolved-symbols +LDFLAGS = $(subst -z defs,,$(LDFLAGS)) --warn-unresolved-symbols -CSRC=$(wildcard *.c) +CSRC := $(wildcard *.c) -OBJS=$(patsubst %.c,%.o, $(CSRC)) +OBJS := $(patsubst %.c,%.o, $(CSRC)) ifeq ($(strip $(HAVE_SHARED)),y) all: $(SO_LIB_NAME) @@ -44,21 +44,21 @@ endif $(AR_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) + $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ + $(AR) $(ARFLAGS) $@ $^ $(SO_LIB_NAME): $(AR_LIB_NAME) - $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).1 $(SO_LIB_NAME) + $(RM) $(TOPDIR)lib/$(SO_FULL_NAME) $(SO_LIB_NAME).1 $@ $(LD) $(LDFLAGS) -soname=$(LIB_NAME).so.1 \ - -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).1 - $(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 clean: $(RM) *.o *~ core diff --git a/libresolv/Makefile b/libresolv/Makefile index e32f1dd8c..f1055b0e5 100644 --- a/libresolv/Makefile +++ b/libresolv/Makefile @@ -26,14 +26,14 @@ include $(TOPDIR)Rules.mak CFLAGS+=$(SSP_ALL_CFLAGS) -LIB_NAME=libresolv -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := libresolv +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so -CSRC = $(wildcard *.c) +CSRC := $(wildcard *.c) -OBJS=$(patsubst %.c,%.o, $(CSRC)) +OBJS := $(patsubst %.c,%.o, $(CSRC)) ifeq ($(strip $(HAVE_SHARED)),y) all: $(SO_LIB_NAME) @@ -43,21 +43,21 @@ endif $(AR_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) + $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ + $(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 clean: $(RM) *.o *~ core diff --git a/librt/Makefile b/librt/Makefile index b17e58057..a7f122841 100644 --- a/librt/Makefile +++ b/librt/Makefile @@ -21,16 +21,16 @@ include $(TOPDIR)Rules.mak CFLAGS+=$(SSP_ALL_CFLAGS) -LIB_NAME=librt -AR_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME=$(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME=$(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +LIB_NAME := librt +AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so # uClibc's librt lacks all aio routines, all clock routines, # and all shm routines -CSRC=$(wildcard *.c) +CSRC := $(wildcard *.c) -OBJS=$(patsubst %.c,%.o, $(CSRC)) +OBJS := $(patsubst %.c,%.o, $(CSRC)) ifeq ($(strip $(HAVE_SHARED)),y) all: $(SO_LIB_NAME) @@ -40,21 +40,21 @@ endif $(AR_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib - $(RM) $(AR_LIB_NAME) - $(AR) $(ARFLAGS) $(AR_LIB_NAME) $(OBJS) + $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ + $(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 clean: $(RM) *.o *~ core diff --git a/libutil/Makefile b/libutil/Makefile index 15c276be3..390c0695d 100644 --- a/libutil/Makefile +++ b/libutil/Makefile @@ -28,8 +28,8 @@ CFLAGS+=$(SSP_ALL_CFLAGS) LIB_NAME := libutil AR_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).a -SO_LIB_NAME := $(TOPDIR)lib/$(LIB_NAME).so -SO_FULL_NAME := $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so +SO_LIB_NAME = $(TOPDIR)lib/$(LIB_NAME).so +SO_FULL_NAME = $(LIB_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so CSRC = $(wildcard *.c) ifneq ($(strip $(ARCH_HAS_MMU)),y) @@ -50,6 +50,7 @@ endif $(AR_LIB_NAME): $(OBJS) $(INSTALL) -d $(TOPDIR)lib $(RM) $@ + $(STRIPTOOL) -x -R .note -R .comment $^ $(AR) $(ARFLAGS) $@ $^ $(SO_LIB_NAME): $(AR_LIB_NAME) @@ -63,11 +64,9 @@ $(SO_LIB_NAME): $(AR_LIB_NAME) $(LIB_NAME).o: $(CSRC) $(CC) $(CFLAGS) -o $@ -c $^ - $(STRIPTOOL) -x -R .note -R .comment $@ $(OBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o clean: $(RM) *.o *~ core |