summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-06-15 19:47:58 +0000
committerEric Andersen <andersen@codepoet.org>2001-06-15 19:47:58 +0000
commitec4e85f8a3471efaf67032d8b7cedc13d40b1446 (patch)
treef7a341d1870ecc5f3e3487a37fb55d9efe177c9a
parentc1ae0ad8262ce40178a54a393bcf466b57ad5819 (diff)
Be consistant for all the client code, and use TARGET_CC with --uclibc-use-build-dir
-rw-r--r--Rules.mak7
-rw-r--r--ldso/libdl/Makefile10
-rw-r--r--ldso/util/Makefile15
-rw-r--r--libcrypt/Makefile8
-rw-r--r--libm/Makefile16
-rw-r--r--libm/double/Makefile24
-rw-r--r--libm/float/Makefile2
-rw-r--r--libm/ldouble/Makefile24
-rw-r--r--libresolv/Makefile8
-rw-r--r--libutil/Makefile8
10 files changed, 58 insertions, 64 deletions
diff --git a/Rules.mak b/Rules.mak
index a90786adc..ba14a2743 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -46,16 +46,23 @@ endif
ARFLAGS=r
CCFLAGS=$(WARNINGS) $(OPTIMIZATION) -fno-builtin -nostdinc $(CPUFLAGS) -I$(TOPDIR)include -I$(GCCINCDIR) -I. -D_LIBC
+TARGET_CCFLAGS=--uclibc-use-build-dir $(WARNINGS) $(OPTIMIZATION) $(CPUFLAGS)
CFLAGS=$(ARCH_CFLAGS) $(CCFLAGS) $(DEFS) $(ARCH_CFLAGS2)
+TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
+TARGET_CFLAGS=$(ARCH_CFLAGS) $(TARGET_CCFLAGS) $(DEFS) $(ARCH_CFLAGS2)
ifeq ($(strip $(DODEBUG)),true)
CFLAGS += -g
+ TARGET_CFLAGS += -g
LDFLAGS = -nostdlib -Wl,-warn-common
+ TARGET_LDFLAGS = -Wl,-warn-common
STRIPTOOL = /bin/true -Since_we_are_debugging
else
CFLAGS += -DNDEBUG #-fomit-frame-pointer
+ TARGET_CFLAGS += -DNDEBUG #-fomit-frame-pointer
LDFLAGS = -s -nostdlib -Wl,-warn-common
+ TARGET_LDFLAGS = -s -Wl,-warn-common
endif
ifndef $(PREFIX)
diff --git a/ldso/libdl/Makefile b/ldso/libdl/Makefile
index f52027250..840fad764 100644
--- a/ldso/libdl/Makefile
+++ b/ldso/libdl/Makefile
@@ -27,12 +27,11 @@ include $(TOPDIR)Rules.mak
LIBDL=libdl.a
LIBDL_SHARED=libdl.so
LIBDL_SHARED_FULLNAME=libdl-$(MAJOR_VERSION).$(MINOR_VERSION).so
-TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
CSRC= dlib.c
OBJS=$(patsubst %.c,%.o, $(CSRC))
-CFLAGS += --uclibc-use-build-dir -DUSE_CACHE #-fPIC -D__PIC__ #-funroll-loops
+TARGET_CFLAGS += -DUSE_CACHE #-fPIC -D__PIC__ #-funroll-loops
all: $(OBJS) $(LIBDL) shared
@@ -45,15 +44,14 @@ ar-target: $(OBJS)
#install -m 644 $(LIBDL) $(TOPDIR)lib
$(OBJS): %.o : %.c
- $(TARGET_CC) -I../d-link -I../d-link/$(TARGET_ARCH) $(CFLAGS) -c $< -o $@
+ $(TARGET_CC) -I../d-link -I../d-link/$(TARGET_ARCH) $(TARGET_CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(OBJ): Makefile
shared: all
- $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBDL_SHARED_FULLNAME) \
- -Wl,-soname,$(LIBDL_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive \
- $(LIBDL) $(TOPDIR)lib/$(SHARED_FULLNAME)
+ $(TARGET_CC) $(TARGET_LDFLAGS) -nostdlib -shared -o $(LIBDL_SHARED_FULLNAME) \
+ -Wl,-soname,$(LIBDL_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBDL)
install -d $(TOPDIR)lib
rm -f $(TOPDIR)lib/$(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBDL_SHARED).$(MAJOR_VERSION)
install -m 644 $(LIBDL_SHARED_FULLNAME) $(TOPDIR)lib;
diff --git a/ldso/util/Makefile b/ldso/util/Makefile
index f2486fdaa..cb5cfea34 100644
--- a/ldso/util/Makefile
+++ b/ldso/util/Makefile
@@ -1,32 +1,29 @@
TOPDIR=../../
include $(TOPDIR)Rules.mak
-CFLAGS=-Wall -Os -I. --uclibc-use-build-dir
-CC = $(TOPDIR)extra/gcc-uClibc/$(NATIVE_ARCH)-uclibc-gcc
-
all: ldconfig ldd readelf
readsoname.o: readsoname.c readsoname2.c
- $(CC) $(CFLAGS) -c $< -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
ldconfig.o: ldconfig.c
- $(CC) $(CFLAGS) -DUCLIBC_ROOT_DIR=\"$(ROOT_DIR)\" -c $< -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -DUCLIBC_ROOT_DIR=\"$(ROOT_DIR)\" -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
ldd.o: ldd.c
- $(CC) $(CFLAGS) -DUCLIBC_ROOT_DIR=\"$(ROOT_DIR)\" \
+ $(TARGET_CC) $(TARGET_CFLAGS) -DUCLIBC_ROOT_DIR=\"$(ROOT_DIR)\" \
-DLDSO_ADDR="0x62f00020" -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
readelf: readelf.c
- $(CC) $(CFLAGS) readelf.c -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) readelf.c -o $@
ldconfig: ldconfig.o readsoname.o
- $(CC) $(CFLAGS) -static $^ -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -static $^ -o $@
ldd: ldd.o readsoname.o
- $(CC) $(CFLAGS) $^ -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) $^ -o $@
clean:
rm -f ldconfig ldd readelf *.o *~ core
diff --git a/libcrypt/Makefile b/libcrypt/Makefile
index 4c118c10b..029f0d8e3 100644
--- a/libcrypt/Makefile
+++ b/libcrypt/Makefile
@@ -26,7 +26,6 @@ include $(TOPDIR)Rules.mak
LIBCRYPT=libcrypt.a
LIBCRYPT_SHARED=libcrypt.so
LIBCRYPT_SHARED_FULLNAME=libcrypt-$(MAJOR_VERSION).$(MINOR_VERSION).so
-TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
CSRC = crypt.c des.c md5.c
OBJS=$(patsubst %.c,%.o, $(CSRC))
@@ -42,15 +41,14 @@ ar-target: $(OBJS)
install -m 644 $(LIBCRYPT) $(TOPDIR)lib
$(OBJS): %.o : %.c
- $(TARGET_CC) $(CFLAGS) -c $< -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(OBJ): Makefile
shared: all
- $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBCRYPT_SHARED_FULLNAME) \
- -Wl,-soname,$(LIBCRYPT_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive \
- $(LIBCRYPT) $(TOPDIR)lib/$(SHARED_FULLNAME)
+ $(TARGET_CC) $(TARGET_LDFLAGS) -nostdlib -shared -o $(LIBCRYPT_SHARED_FULLNAME) \
+ -Wl,-soname,$(LIBCRYPT_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBCRYPT)
install -d $(TOPDIR)lib
rm -f $(TOPDIR)lib/$(LIBCRYPT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBCRYPT_SHARED).$(MAJOR_VERSION)
install -m 644 $(LIBCRYPT_SHARED_FULLNAME) $(TOPDIR)lib;
diff --git a/libm/Makefile b/libm/Makefile
index c07190fb1..c6ac49ce0 100644
--- a/libm/Makefile
+++ b/libm/Makefile
@@ -25,7 +25,6 @@ include $(TOPDIR)Rules.mak
LIBM=libm.a
LIBM_SHARED=libm.so
LIBM_SHARED_FULLNAME=libm-$(MAJOR_VERSION).$(MINOR_VERSION).so
-TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
DIRS=
ifeq ($(strip $(HAS_LIBM_FLOAT)),true)
@@ -53,14 +52,13 @@ tags:
shared: all
if [ -f $(LIBM) ] ; then \
- $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBM_SHARED_FULLNAME) \
- -Wl,-soname,$(LIBM_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive \
- $(LIBM) $(TOPDIR)lib/$(SHARED_FULLNAME); \
- install -d $(TOPDIR)lib; \
- rm -f $(TOPDIR)lib/$(LIBM_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBM_SHARED).$(MAJOR_VERSION); \
- install -m 644 $(LIBM_SHARED_FULLNAME) $(TOPDIR)lib; \
- (cd $(TOPDIR)lib; ln -sf $(LIBM_SHARED_FULLNAME) $(LIBM_SHARED)); \
- (cd $(TOPDIR)lib; ln -sf $(LIBM_SHARED_FULLNAME) $(LIBM_SHARED).$(MAJOR_VERSION)); \
+ $(TARGET_CC) $(TARGET_LDFLAGS) -nostdlib -shared -o $(LIBM_SHARED_FULLNAME) \
+ -Wl,-soname,$(LIBM_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBM); \
+ install -d $(TOPDIR)lib; \
+ rm -f $(TOPDIR)lib/$(LIBM_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBM_SHARED).$(MAJOR_VERSION); \
+ install -m 644 $(LIBM_SHARED_FULLNAME) $(TOPDIR)lib; \
+ (cd $(TOPDIR)lib; ln -sf $(LIBM_SHARED_FULLNAME) $(LIBM_SHARED)); \
+ (cd $(TOPDIR)lib; ln -sf $(LIBM_SHARED_FULLNAME) $(LIBM_SHARED).$(MAJOR_VERSION)); \
fi;
subdirs: $(patsubst %, _dir_%, $(DIRS))
diff --git a/libm/double/Makefile b/libm/double/Makefile
index 6133ef199..a53b44d2e 100644
--- a/libm/double/Makefile
+++ b/libm/double/Makefile
@@ -50,7 +50,7 @@ ar-target: $(OBJS)
$(AR) $(ARFLAGS) $(LIBM) $(OBJS)
$(COBJS): %.o : %.c
- $(TARGET_CC) $(CFLAGS) -c $< -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(OBJ): Makefile
@@ -65,37 +65,37 @@ clean:
#all: libmd.a mtst dtestvec monot dcalc paranoia
time-it: time-it.o
- $(CC) -o time-it time-it.o
+ $(TARGET_CC) -o time-it time-it.o
time-it.o: time-it.c
- $(CC) -O2 -c time-it.c
+ $(TARGET_CC) -O2 -c time-it.c
dcalc: dcalc.o libmd.a
- $(CC) -o dcalc dcalc.o libmd.a
+ $(TARGET_CC) -o dcalc dcalc.o libmd.a
mtst: mtst.o libmd.a
- $(CC) -v -o mtst mtst.o libmd.a
+ $(TARGET_CC) -v -o mtst mtst.o libmd.a
mtst.o: mtst.c
- $(CC) -O2 -Wall -c mtst.c
+ $(TARGET_CC) -O2 -Wall -c mtst.c
dtestvec: dtestvec.o libmd.a
- $(CC) -o dtestvec dtestvec.o libmd.a
+ $(TARGET_CC) -o dtestvec dtestvec.o libmd.a
dtestvec.o: dtestvec.c
- $(CC) -g -c dtestvec.c
+ $(TARGET_CC) -g -c dtestvec.c
monot: monot.o libmd.a
- $(CC) -o monot monot.o libmd.a
+ $(TARGET_CC) -o monot monot.o libmd.a
monot.o: monot.c
- $(CC) -g -c monot.c
+ $(TARGET_CC) -g -c monot.c
paranoia: paranoia.o setprec.o libmd.a
- $(CC) -o paranoia paranoia.o setprec.o libmd.a
+ $(TARGET_CC) -o paranoia paranoia.o setprec.o libmd.a
paranoia.o: paranoia.c
- $(CC) $(CFLAGS) -Wno-implicit -c paranoia.c
+ $(TARGET_CC) $(TARGET_CFLAGS) -Wno-implicit -c paranoia.c
libmd.a: $(OBJS) $(INCS)
$(AR) rv libmd.a $(OBJS)
diff --git a/libm/float/Makefile b/libm/float/Makefile
index bae5fecea..80f7aa1ff 100644
--- a/libm/float/Makefile
+++ b/libm/float/Makefile
@@ -49,7 +49,7 @@ ar-target: $(OBJS)
$(AR) $(ARFLAGS) $(LIBM) $(OBJS)
$(COBJS): %.o : %.c
- $(TARGET_CC) $(CFLAGS) -c $< -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(OBJ): Makefile
diff --git a/libm/ldouble/Makefile b/libm/ldouble/Makefile
index 04b3aacac..dad448840 100644
--- a/libm/ldouble/Makefile
+++ b/libm/ldouble/Makefile
@@ -45,7 +45,7 @@ ar-target: $(OBJS)
$(AR) $(ARFLAGS) $(LIBM) $(OBJS)
$(COBJS): %.o : %.c
- $(TARGET_CC) $(CFLAGS) -c $< -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(OBJ): Makefile
@@ -61,20 +61,20 @@ clean:
#all: mtstl lparanoi lcalc fltestl nantst testvect monotl libml.a
mtstl: libml.a mtstl.o $(OBJS)
- $(CC) $(CFLAGS) -o mtstl mtstl.o libml.a $(LIBS)
+ $(TARGET_CC) $(TARGET_CFLAGS) -o mtstl mtstl.o libml.a $(LIBS)
mtstl.o: mtstl.c
lparanoi: libml.a lparanoi.o setprec.o ieee.o econst.o $(OBJS)
- $(CC) $(CFLAGS) -o lparanoi lparanoi.o setprec.o ieee.o econst.o libml.a $(LIBS)
+ $(TARGET_CC) $(TARGET_CFLAGS) -o lparanoi lparanoi.o setprec.o ieee.o econst.o libml.a $(LIBS)
lparanoi.o: lparanoi.c
- $(CC) $(CFLAGS) -Wno-implicit -c lparanoi.c
+ $(TARGET_CC) $(TARGET_CFLAGS) -Wno-implicit -c lparanoi.c
econst.o: econst.c ehead.h
lcalc: libml.a lcalc.o ieee.o econst.o $(OBJS)
- $(CC) $(CFLAGS) -o lcalc lcalc.o ieee.o econst.o libml.a $(LIBS)
+ $(TARGET_CC) $(TARGET_CFLAGS) -o lcalc lcalc.o ieee.o econst.o libml.a $(LIBS)
lcalc.o: lcalc.c lcalc.h ehead.h
@@ -87,31 +87,31 @@ libml.a: $(OBJS) mconf.h
fltestl: fltestl.c libml.a
- $(CC) $(CFLAGS) -o fltestl fltestl.c libml.a
+ $(TARGET_CC) $(TARGET_CFLAGS) -o fltestl fltestl.c libml.a
fltestl.o: fltestl.c
flrtstl: flrtstl.c libml.a
- $(CC) $(CFLAGS) -o flrtstl flrtstl.c libml.a
+ $(TARGET_CC) $(TARGET_CFLAGS) -o flrtstl flrtstl.c libml.a
flrtstl.o: flrtstl.c
nantst: nantst.c libml.a
- $(CC) $(CFLAGS) -o nantst nantst.c libml.a
+ $(TARGET_CC) $(TARGET_CFLAGS) -o nantst nantst.c libml.a
nantst.o: nantst.c
testvect: testvect.o libml.a
- $(CC) $(CFLAGS) -o testvect testvect.o libml.a
+ $(TARGET_CC) $(TARGET_CFLAGS) -o testvect testvect.o libml.a
testvect.o: testvect.c
- $(CC) -g -c -o testvect.o testvect.c
+ $(TARGET_CC) -g -c -o testvect.o testvect.c
monotl: monotl.o libml.a
- $(CC) $(CFLAGS) -o monotl monotl.o libml.a
+ $(TARGET_CC) $(TARGET_CFLAGS) -o monotl monotl.o libml.a
monotl.o: monotl.c
- $(CC) -g -c -o monotl.o monotl.c
+ $(TARGET_CC) -g -c -o monotl.o monotl.c
# Run test programs
check: mtstl fltestl testvect monotl libml.a
diff --git a/libresolv/Makefile b/libresolv/Makefile
index 75c62c745..219c31d77 100644
--- a/libresolv/Makefile
+++ b/libresolv/Makefile
@@ -26,7 +26,6 @@ include $(TOPDIR)Rules.mak
LIBRESOLV=libresolv.a
LIBRESOLV_SHARED=libresolv.so
LIBRESOLV_SHARED_FULLNAME=libresolv-$(MAJOR_VERSION).$(MINOR_VERSION).so
-TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
CSRC = resolv.c
OBJS=$(patsubst %.c,%.o, $(CSRC))
@@ -42,15 +41,14 @@ ar-target: $(OBJS)
install -m 644 $(LIBRESOLV) $(TOPDIR)lib
$(OBJS): %.o : %.c
- $(TARGET_CC) $(CFLAGS) -c $< -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(OBJ): Makefile
shared: all
- $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBRESOLV_SHARED_FULLNAME) \
- -Wl,-soname,$(LIBRESOLV_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive \
- $(LIBRESOLV) $(TOPDIR)lib/$(SHARED_FULLNAME)
+ $(TARGET_CC) $(TARGET_LDFLAGS) -nostdlib -shared -o $(LIBRESOLV_SHARED_FULLNAME) \
+ -Wl,-soname,$(LIBRESOLV_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBRESOLV)
install -d $(TOPDIR)lib
rm -f $(TOPDIR)lib/$(LIBRESOLV_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBRESOLV_SHARED).$(MAJOR_VERSION)
install -m 644 $(LIBRESOLV_SHARED_FULLNAME) $(TOPDIR)lib;
diff --git a/libutil/Makefile b/libutil/Makefile
index 6c12869e7..c1ac9022b 100644
--- a/libutil/Makefile
+++ b/libutil/Makefile
@@ -27,7 +27,6 @@ LIBC=$(TOPDIR)libc.a
LIBUTIL=libutil.a
LIBUTIL_SHARED=libutil.so
LIBUTIL_SHARED_FULLNAME=libutil-$(MAJOR_VERSION).$(MINOR_VERSION).so
-TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc
CSRC=forkpty.c login.c login_tty.c logout.c logwtmp.c openpty.c
OBJS=$(patsubst %.c,%.o, $(CSRC))
@@ -43,13 +42,12 @@ ar-target: $(OBJS)
install -m 644 $(LIBUTIL) $(TOPDIR)lib/
$(OBJS): %.o : %.c
- $(TARGET_CC) $(CFLAGS) -c $< -o $@
+ $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
shared: all
- $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBUTIL_SHARED_FULLNAME) \
- -Wl,-soname,$(LIBUTIL_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive \
- $(LIBUTIL) $(TOPDIR)lib/$(SHARED_FULLNAME)
+ $(TARGET_CC) $(TARGET_LDFLAGS) -nostdlib -shared -o $(LIBUTIL_SHARED_FULLNAME) \
+ -Wl,-soname,$(LIBUTIL_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBUTIL)
install -d $(TOPDIR)lib
rm -f $(TOPDIR)lib/$(LIBUTIL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBUTIL_SHARED).$(MAJOR_VERSION)
install -m 644 $(LIBUTIL_SHARED_FULLNAME) $(TOPDIR)lib/;