From 20f3e646d8d5f41f009493ee8b193dd75436afbc Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Wed, 4 Nov 2009 21:56:40 +0000 Subject: Clean up mktccboot building. No functional changes. - Adjust the Makefile similar to the changes done in r23520. - Split out the standalone part into a separate source file. - Put telechips.o inside the archive instead of building it separately for rbutil. It is part of mktccboot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23522 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/mktccboot/Makefile | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'rbutil/mktccboot/Makefile') diff --git a/rbutil/mktccboot/Makefile b/rbutil/mktccboot/Makefile index cd8a539648..f51c462766 100644 --- a/rbutil/mktccboot/Makefile +++ b/rbutil/mktccboot/Makefile @@ -45,25 +45,35 @@ OUT = $(TARGET_DIR)build$(RBARCH) all: $(OUTPUT) -$(OUT)/telechips.o: $(TOOLSDIR)/telechips.[ch] +# inputs +LIBSOURCES := mktccboot.c $(TOOLSDIR)/telechips.o +SOURCES := $(LIBSOURCES) main.c +OBJS := $(patsubst %.c,%.o,$(addprefix $(OUT)/,$(notdir $(SOURCES)))) +LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OUT)/,$(notdir $(LIBSOURCES)))) +EXTRADEPS := + +# rule for sources from tools dir +$(OUT)/%.o: $(TOOLSDIR)/%.c $(OUT) @echo CC $< - $(SILENT)$(CC) $(CFLAGS) -c -o $(OUT)/telechips.o $(TOOLSDIR)/telechips.c + $(SILENT)$(CC) $(CFLAGS) -c -o $@ $< -$(OUT)/mktccboot.o: mktccboot.[ch] $(OUT)/telechips.o +$(OUT)/%.o: %.c $(OUT) @echo CC $< - $(SILENT)$(CC) $(CFLAGS) -c -o $(OUT)/mktccboot.o -W -Wall mktccboot.c -DVERSION=\"$(APPVERSION)\" - -$(OUTPUT): $(OUT) $(OUT)/mktccboot.o - @echo LD $@ - $(SILENT)$(CC) $(CFLAGS) -o $(OUTPUT) $(OUT)/mktccboot.o $(OUT)/telechips.o + $(SILENT)$(CC) $(CFLAGS) -c -o $@ $< +# building the library archive $(OUT)/libmktccboot.o: $(OUT)/mktccboot.o @echo CC $< $(SILENT)$(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmktccboot.o -W -Wall mktccboot.c -libmktccboot$(RBARCH).a: $(OUT) $(OUT)/libmktccboot.o +libmktccboot$(RBARCH).a: $(LIBOBJS) @echo AR $@ - $(SILENT)$(AR) ruc $(TARGET_DIR)libmktccboot$(RBARCH).a $(OUT)/libmktccboot.o + $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^ + +# building the standalone executable +$(OUTPUT): $(OBJS) $(EXTRADEPS) + @echo LD $@ + $(SILENT)$(CC) $(CFLAGS) -o$(OUTPUT) $(OBJS) $(EXTRADEPS) # some trickery to build ppc and i386 from a single call ifeq ($(RBARCH),) @@ -80,9 +90,8 @@ libmktccboot-universal: libmktccbooti386.a libmktccbootppc.a lipo -create $(TARGET_DIR)libmktccbootppc.a $(TARGET_DIR)libmktccbooti386.a -output $(TARGET_DIR)libmktccboot.a clean: - rm -f $(OUTPUT) libmktccboot.o $(TARGET_DIR)libmktccboot*.a mktccboot.dmg - rm -f $(TOOLSDIR)/telechips.o - rm -rf build* mktccboot-* + rm -f $(OUTPUT) $(TARGET_DIR)libmktccboot*.a mktccboot.dmg + rm -rf $(OUT) mktccboot-i386: $(MAKE) RBARCH=i386 -- cgit v1.2.3