summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-18 18:51:57 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-18 18:51:57 +0000
commit3c2b1d8bbed09450c9945006b9b5c5e39b15092f (patch)
tree690c5250587271f62629f3343dae24279f9e2344
parent36c36f5268eafce32005d2ffd47e0ff506d1e2a3 (diff)
downloaddrakx-3c2b1d8bbed09450c9945006b9b5c5e39b15092f.tar
drakx-3c2b1d8bbed09450c9945006b9b5c5e39b15092f.tar.gz
drakx-3c2b1d8bbed09450c9945006b9b5c5e39b15092f.tar.bz2
drakx-3c2b1d8bbed09450c9945006b9b5c5e39b15092f.tar.xz
drakx-3c2b1d8bbed09450c9945006b9b5c5e39b15092f.zip
- Use minilibc on x86-64
- mar requires bzlib to be built beforehand, especially if building with dietlibc - Nuke trickery to handle -DIET objects, everything is now built through the diet driver, defined into $(DIET)
-rw-r--r--mdk-stage1/Makefile54
-rw-r--r--mdk-stage1/Makefile.common8
-rw-r--r--mdk-stage1/bzlib/Makefile15
-rw-r--r--mdk-stage1/insmod-modutils/Makefile18
-rw-r--r--mdk-stage1/insmod-modutils/obj/Makefile4
-rw-r--r--mdk-stage1/insmod-modutils/util/Makefile8
-rw-r--r--mdk-stage1/mar/Makefile22
-rw-r--r--mdk-stage1/newt/Makefile16
-rw-r--r--mdk-stage1/slang/Makefile16
9 files changed, 51 insertions, 110 deletions
diff --git a/mdk-stage1/Makefile b/mdk-stage1/Makefile
index d94a49c12..7162d78c3 100644
--- a/mdk-stage1/Makefile
+++ b/mdk-stage1/Makefile
@@ -34,8 +34,8 @@
# stage1 with glibc
#
# x86-64
- # init with glibc
- # stage1 with glibc
+ # init with minilibc
+ # stage1 with dietlibc
#
#*****************************************************************************
@@ -58,10 +58,8 @@ INITSRC = minilibc.c init.c
INIT_DEFS = -DINIT_HEADERS=\"minilibc.h\" -fno-builtin
else
ifeq (x86_64, $(ARCH))
-#INITSRC = minilibc.c init.c
-#INIT_DEFS = -DINIT_HEADERS=\"minilibc.h\" -fno-builtin
-INITSRC = init.c
-INIT_DEFS = -DINIT_HEADERS=\"init-libc-headers.h\" $(GLIBC_INCLUDES)
+INITSRC = minilibc.c init.c
+INIT_DEFS = -DINIT_HEADERS=\"minilibc.h\" -fno-builtin
else
INITSRC = init.c
ifeq (ia64, $(ARCH))
@@ -77,17 +75,16 @@ INITOBJS = $(subst .c,.o,$(INITSRC))
#- frontends
NEWT_FRONTEND_SRC = newt-frontend.c
-GLIBC_NEWT_FRONTEND_LIBS = newt/libnewt.a slang/libslang.a
-DIETLIBC_NEWT_FRONTEND_LIBS = $(subst .a,-DIET.a,$(GLIBC_NEWT_FRONTEND_LIBS))
+NEWT_FRONTEND_LIBS = newt/libnewt.a slang/libslang.a
STDIO_FRONTEND_SRC = stdio-frontend.c
-GLIBC_STDIO_FRONTEND_LIBS =
-DIETLIBC_STDIO_FRONTEND_LIBS =
+STDIO_FRONTEND_LIBS =
+STDIO_FRONTEND_LIBS =
FRONTEND_OBJS = $(subst .c,.o,$($(F)_FRONTEND_SRC))
-FRONTEND_LINK = $(FRONTEND_OBJS) $($(L)_$(F)_FRONTEND_LIBS)
+FRONTEND_LINK = $(FRONTEND_OBJS) $($(F)_FRONTEND_LIBS)
ifeq (i386, $(ARCH))
INSMOD = insmod-busybox
@@ -95,9 +92,7 @@ else
INSMOD = insmod-modutils
endif
-GLIBC_STAGE1_OWN_LIBS = $(INSMOD)/libinsmod.a mar/libmar.a bzlib/libbzlib.a
-DIETLIBC_STAGE1_OWN_LIBS = $(subst .a,-DIET.a,$(GLIBC_STAGE1_OWN_LIBS))
-STAGE1_OWN_LIBS = $($(L)_STAGE1_OWN_LIBS)
+STAGE1_OWN_LIBS = $(INSMOD)/libinsmod.a mar/libmar.a bzlib/libbzlib.a
ifeq (DIETLIBC, $(L))
@@ -146,8 +141,7 @@ ifeq (i386, $(ARCH))
LDFLAGS_INIT = -static -nostdlib /usr/lib/crt1.o
else
ifeq (x86_64, $(ARCH))
-#LDFLAGS_INIT = -static -nostdlib /usr/lib64/crt1.o
-LDFLAGS_INIT = $(GLIBC_LDFLAGS_STAGE1)
+LDFLAGS_INIT = -static -nostdlib /usr/lib64/crt1.o
INIT_LIBC = $(GLIBC_LIBC)
else
ifeq (ia64, $(ARCH))
@@ -173,7 +167,7 @@ endif
ifeq (ppc, $(ARCH))
DIRS = dietlibc
endif
-DIRS += mar pci-resource usb-resource bzlib $(INSMOD) slang newt
+DIRS += bzlib mar pci-resource usb-resource $(INSMOD) slang newt
ifneq (x86_64, $(ARCH))
DIRS += ppp/pppd rp-pppoe/src
endif
@@ -183,9 +177,7 @@ endif
ifeq (i386,$(ARCH))
-GLIBC_PCMCIA_LIB = pcmcia_/libpcmcia.a
-DIETLIBC_PCMCIA_LIB = $(subst .a,-DIET.a,$(GLIBC_PCMCIA_LIB))
-PCMCIA_LIB = $($(L)_PCMCIA_LIB)
+PCMCIA_LIB = pcmcia_/libpcmcia.a
PCMCIA_DEFS = -DENABLE_PCMCIA
endif
@@ -204,23 +196,23 @@ init: $(INITOBJS) $(INIT_LIBC)
$(STRIPCMD) $@
stage1-cdrom: $(STAGE1OBJS-CDROM) $(STAGE1_OWN_LIBS) $(FRONTEND_LINK) $(STAGE1_LIBC)
- $(CC) $(LDFLAGS_STAGE1) -o $@ $^
+ $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
$(STRIPCMD) $@
stage1-disk: $(STAGE1OBJS-DISK) $(STAGE1_OWN_LIBS) $(FRONTEND_LINK) $(STAGE1_LIBC)
- $(CC) $(LDFLAGS_STAGE1) -o $@ $^
+ $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
$(STRIPCMD) $@
stage1-network: $(STAGE1OBJS-NETWORK) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS) $(FRONTEND_LINK) $(PCMCIA_LIB) $(STAGE1_LIBC)
- $(CC) $(LDFLAGS_STAGE1) -o $@ $^
+ $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
$(STRIPCMD) $@
stage1-usb: $(STAGE1OBJS-USB) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS) $(FRONTEND_LINK) $(STAGE1_LIBC)
- $(CC) $(LDFLAGS_STAGE1) -o $@ $^
+ $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
$(STRIPCMD) $@
stage1-full: $(STAGE1OBJS-FULL) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS) $(FRONTEND_LINK) $(PCMCIA_LIB) $(STAGE1_LIBC)
- $(CC) $(LDFLAGS_STAGE1) -o $@ $^
+ $(DIET) $(CC) $(LDFLAGS_STAGE1) -o $@ $^
$(STRIPCMD) $@
@@ -228,22 +220,22 @@ $(INITOBJS): %.o: %.c
$(COMPILE) $(INIT_DEFS) -c $<
$(STAGE1OBJS-CDROM): %-CDROM.o: %.c
- $(COMPILE) $(INCLUDES) $(CDROM_DEFS) -c $< -o $@
+ $(DIET) $(COMPILE) $(INCLUDES) $(CDROM_DEFS) -c $< -o $@
$(STAGE1OBJS-DISK): %-DISK.o: %.c
- $(COMPILE) $(INCLUDES) $(DISK_DEFS) -c $< -o $@
+ $(DIET) $(COMPILE) $(INCLUDES) $(DISK_DEFS) -c $< -o $@
$(STAGE1OBJS-NETWORK): %-NETWORK.o: %.c
- $(COMPILE) $(INCLUDES) $(NETWORK_DEFS) $(PCMCIA_DEFS) -c $< -o $@
+ $(DIET) $(COMPILE) $(INCLUDES) $(NETWORK_DEFS) $(PCMCIA_DEFS) -c $< -o $@
$(STAGE1OBJS-USB): %-USB.o: %.c
- $(COMPILE) $(INCLUDES) $(USB_DEFS) -c $< -o $@
+ $(DIET) $(COMPILE) $(INCLUDES) $(USB_DEFS) -c $< -o $@
$(STAGE1OBJS-FULL): %-FULL.o: %.c
- $(COMPILE) $(INCLUDES) $(USB_DEFS_GEN) $(PCMCIA_DEFS) -c $< -o $@
+ $(DIET) $(COMPILE) $(INCLUDES) $(USB_DEFS_GEN) $(PCMCIA_DEFS) -c $< -o $@
.c.o:
- $(COMPILE) $(INCLUDES) -c $<
+ $(DIET) $(COMPILE) $(INCLUDES) -c $<
clean:
diff --git a/mdk-stage1/Makefile.common b/mdk-stage1/Makefile.common
index 088d70097..0103b5d73 100644
--- a/mdk-stage1/Makefile.common
+++ b/mdk-stage1/Makefile.common
@@ -36,6 +36,10 @@ ifeq (x86_64, $(ARCH))
L = GLIBC
endif
+ifeq (DIETLIBC, $(L))
+DIET = $(top_dir)/dietlibc/bin-$(ARCH)/diet
+endif
+
#- flags used by all stuff
ifeq (ppc, $(ARCH))
@@ -49,11 +53,11 @@ GLIBC_INCLUDES = -I. -I$(top_dir)/bzlib
INCLUDES = $($(L)_INCLUDES)
GLIBC_LDFLAGS_STAGE1 = -static
-DIETLIBC_LDFLAGS_STAGE1 = -nostdlib $(top_dir)/dietlibc/bin-$(ARCH)/start.o
+DIETLIBC_LDFLAGS_STAGE1 = -nostdlib
LDFLAGS_STAGE1 = $($(L)_LDFLAGS_STAGE1)
GLIBC_LIBC =
-DIETLIBC_LIBC = $(top_dir)/dietlibc/bin-$(ARCH)/dietlibc.a
+DIETLIBC_LIBC =
STAGE1_LIBC = $($(L)_LIBC)
STRIPCMD = strip -R .note -R .comment
diff --git a/mdk-stage1/bzlib/Makefile b/mdk-stage1/bzlib/Makefile
index 03a2c254b..8e4bba791 100644
--- a/mdk-stage1/bzlib/Makefile
+++ b/mdk-stage1/bzlib/Makefile
@@ -29,27 +29,14 @@ INCS =
TARGETS = $(LIBNAME).a
-ifeq (DIETLIBC, $(L))
-TARGETS += $(LIBNAME)-DIET.a
-endif
-
all: $(TARGETS)
clean:
rm -f *.o *.a
-OBJS-DIET = $(subst .o,-DIET.o,$(OBJS))
-
$(LIBNAME).a: $(OBJS)
ar -cru $@ $^
ranlib $@
-$(LIBNAME)-DIET.a: $(OBJS-DIET)
- ar -cru $@ $^
- ranlib $@
-
$(OBJS): %.o: %.c
- $(CC) $(CFLAGS) $(DEFS) $(INCS) $(GLIBC_INCLUDES) -c $< -o $@
-
-$(OBJS-DIET): %-DIET.o: %.c
- $(CC) $(CFLAGS) $(DEFS) $(INCS) $(DIETLIBC_INCLUDES) -c $< -o $@
+ $(DIET) $(CC) $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -c $< -o $@
diff --git a/mdk-stage1/insmod-modutils/Makefile b/mdk-stage1/insmod-modutils/Makefile
index 794cfb22e..48508ba1f 100644
--- a/mdk-stage1/insmod-modutils/Makefile
+++ b/mdk-stage1/insmod-modutils/Makefile
@@ -24,7 +24,7 @@ DEFS = -Wno-error -D_GNU_SOURCE \
DIRS = util obj
-all: dirs insmod libinsmod.a #libinsmod-DIET.a
+all: dirs insmod libinsmod.a
dirs:
@for n in . $(DIRS); do \
@@ -35,11 +35,11 @@ clean:
@for n in $(DIRS); do \
(cd $$n; make clean) \
done
- rm -rf t *.o insmod libinsmod.a libinsmod-DIET.a
+ rm -rf t *.o insmod libinsmod.a
insmod: insmod-frontend.o insmod.o ./util/libutil-STANDALONE.a ./obj/libobj.a
- gcc -o $@ $^
+ $(DIET) gcc -o $@ $^
$(STRIPCMD) $@
t/.create_stuff: util/libutil.a obj/libobj.a
@@ -52,16 +52,8 @@ libinsmod.a: insmod.o t/.create_stuff
ar cru $@ insmod.o t/*
ranlib $@
-libinsmod-DIET.a: insmod-DIET.o ./util/libutil-DIET.a ./obj/libobj-DIET.a
- ar cru $@ $^
- ranlib $@
-
insmod-frontend.o: insmod-frontend.c insmod.c
- gcc $(CFLAGS) $(DEFS) $(INCS) $(GLIBC_INCLUDES) -c insmod-frontend.c
+ $(DIET) gcc $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -c insmod-frontend.c
insmod.o: insmod.c
- gcc $(CFLAGS) $(DEFS) $(INCS) $(GLIBC_INCLUDES) -c insmod.c
-
-insmod-DIET.o: insmod.c
- gcc $(CFLAGS) $(DEFS) $(INCS) $(DIETLIBC_INCLUDES) -o $@ -c insmod.c
-
+ $(DIET) gcc $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -c insmod.c
diff --git a/mdk-stage1/insmod-modutils/obj/Makefile b/mdk-stage1/insmod-modutils/obj/Makefile
index 4539a4cf7..d44b2a6c6 100644
--- a/mdk-stage1/insmod-modutils/obj/Makefile
+++ b/mdk-stage1/insmod-modutils/obj/Makefile
@@ -34,5 +34,5 @@ libobj.a: $(OBJS)
ar cru $@ $^
ranlib $@
-.c.o:
- gcc $(CFLAGS) $(DEFS) $(INCS) $(GLIBC_INCLUDES) -c $<
+%.o: %.c
+ $(DIET) gcc $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -c $<
diff --git a/mdk-stage1/insmod-modutils/util/Makefile b/mdk-stage1/insmod-modutils/util/Makefile
index 763f046f2..dd8107435 100644
--- a/mdk-stage1/insmod-modutils/util/Makefile
+++ b/mdk-stage1/insmod-modutils/util/Makefile
@@ -13,7 +13,7 @@ top_dir = ../..
include $(top_dir)/Makefile.common
-all: libutil.a libutil-STANDALONE.a #libutil-DIET.a
+all: libutil.a libutil-STANDALONE.a
clean:
rm -f *.o *.a
@@ -36,7 +36,7 @@ libutil-STANDALONE.a: $(OBJS) logger-standalone.o
ranlib $@
logger-standalone.o: logger.c
- gcc $(CFLAGS) $(DEFS) $(INCS) $(GLIBC_INCLUDES) -o $@ -D_STANDALONE_ -c logger.c
+ $(DIET) gcc $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -o $@ -D_STANDALONE_ -c logger.c
-.c.o:
- gcc $(CFLAGS) $(DEFS) $(INCS) $(GLIBC_INCLUDES) -c $<
+%.o: %.c
+ $(DIET) gcc $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -c $<
diff --git a/mdk-stage1/mar/Makefile b/mdk-stage1/mar/Makefile
index 801785947..94a7a9b88 100644
--- a/mdk-stage1/mar/Makefile
+++ b/mdk-stage1/mar/Makefile
@@ -24,38 +24,32 @@ include $(top_dir)/Makefile.common
TARGETS = libmar.a mar
-
ifeq (DIETLIBC, $(L))
-TARGETS += libmar-DIET.a
+BZLIB = -L $(top_dir)/bzlib -lbzlib
+else
+BZLIB = -lbz2
endif
all: $(TARGETS)
clean:
- rm -f *.o libmar.a libmar-DIET.a mar
+ rm -f *.o libmar.a mar
mar: mar-frontend.o mar-extract-only-standalone.o
- gcc -o mar mar-frontend.o mar-extract-only-standalone.o -lbz2
+ $(DIET) gcc -o mar mar-frontend.o mar-extract-only-standalone.o $(BZLIB)
$(STRIPCMD) $@
libmar.a: mar-extract-only.o
ar -cru $@ $^
ranlib $@
-libmar-DIET.a: mar-extract-only-DIET.o
- ar -cru $@ $^
- ranlib $@
-
mar-extract-only.o: mar-extract-only.c mar-extract-only.h mar.h
- gcc $(CFLAGS) $(GLIBC_INCLUDES) -c mar-extract-only.c
-
-mar-extract-only-DIET.o: mar-extract-only.c mar-extract-only.h mar.h
- gcc $(CFLAGS) $(DIETLIBC_INCLUDES) -o $@ -c mar-extract-only.c
+ $(DIET) gcc $(CFLAGS) $(INCLUDES) -c mar-extract-only.c
mar-frontend.o: mar-frontend.c mar.h mar-extract-only.h
- gcc $(CFLAGS) $(GLIBC_INCLUDES) -c mar-frontend.c
+ $(DIET) gcc $(CFLAGS) $(INCLUDES) -c mar-frontend.c
mar-extract-only-standalone.o: mar-extract-only.c mar-extract-only.h mar.h
- gcc $(CFLAGS) $(GLIBC_INCLUDES) -o $@ -D_STANDALONE_ -c mar-extract-only.c
+ $(DIET) gcc $(CFLAGS) $(INCLUDES) -o $@ -D_STANDALONE_ -c mar-extract-only.c
diff --git a/mdk-stage1/newt/Makefile b/mdk-stage1/newt/Makefile
index 171bcf0cb..b5b3ea8b7 100644
--- a/mdk-stage1/newt/Makefile
+++ b/mdk-stage1/newt/Makefile
@@ -29,28 +29,14 @@ INCS = -I../slang
TARGETS = $(LIBNAME).a
-ifeq (DIETLIBC, $(L))
-TARGETS += $(LIBNAME)-DIET.a
-endif
-
all: $(TARGETS)
clean:
rm -f *.o *.a
-OBJS-DIET = $(subst .o,-DIET.o,$(OBJS))
-
$(LIBNAME).a: $(OBJS)
ar -cru $@ $^
ranlib $@
-$(LIBNAME)-DIET.a: $(OBJS-DIET)
- ar -cru $@ $^
- ranlib $@
-
$(OBJS): %.o: %.c
- gcc $(CFLAGS) $(DEFS) $(INCS) $(GLIBC_INCLUDES) -c $< -o $@
-
-$(OBJS-DIET): %-DIET.o: %.c
- gcc $(CFLAGS) $(DEFS) $(INCS) $(DIETLIBC_INCLUDES) -c $< -o $@
-
+ $(DIET) gcc $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -c $< -o $@
diff --git a/mdk-stage1/slang/Makefile b/mdk-stage1/slang/Makefile
index 4cd1dc6bb..01700651d 100644
--- a/mdk-stage1/slang/Makefile
+++ b/mdk-stage1/slang/Makefile
@@ -29,28 +29,14 @@ INCS =
TARGETS = $(LIBNAME).a
-ifeq (DIETLIBC, $(L))
-TARGETS += $(LIBNAME)-DIET.a
-endif
-
all: $(TARGETS)
clean:
rm -f *.o *.a
-OBJS-DIET = $(subst .o,-DIET.o,$(OBJS))
-
$(LIBNAME).a: $(OBJS)
ar -cru $@ $^
ranlib $@
-$(LIBNAME)-DIET.a: $(OBJS-DIET)
- ar -cru $@ $^
- ranlib $@
-
$(OBJS): %.o: %.c
- gcc $(CFLAGS) $(DEFS) $(INCS) $(GLIBC_INCLUDES) -c $< -o $@
-
-$(OBJS-DIET): %-DIET.o: %.c
- gcc $(CFLAGS) $(DEFS) $(INCS) $(DIETLIBC_INCLUDES) -c $< -o $@
-
+ $(DIET) gcc $(CFLAGS) $(DEFS) $(INCS) $(INCLUDES) -c $< -o $@