summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2009-10-30 14:27:16 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2009-10-30 14:27:16 +0000
commit08c5a66f8ac08b5d2d25d8804e6c8603577664f7 (patch)
treeb25a28430ccbb460738b9ed36f62d768db277903
parent0fb781ef415c1591fb5ea0ba0f0f833535f828c5 (diff)
mktccboot: Remove excessive use of defines in Makefile
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23420 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/mktccboot/Makefile84
1 files changed, 36 insertions, 48 deletions
diff --git a/rbutil/mktccboot/Makefile b/rbutil/mktccboot/Makefile
index 9399a0c09f..3f23e044d6 100644
--- a/rbutil/mktccboot/Makefile
+++ b/rbutil/mktccboot/Makefile
@@ -11,13 +11,9 @@
TOOLSDIR=../../tools
CFLAGS := -O -g -W -Wall -Wshadow -pedantic -I$(TOOLSDIR)
-PLAT=tcc
-
CC = gcc
-MKPLATBOOT=mk$(PLAT)boot
-LIB_MKPLATBOOT=lib$(MKPLATBOOT)
-#change for releases
+# Change for releases
ifndef APPVERSION
APPVERSION=`$(TOOLSDIR)/version.sh`
endif
@@ -27,16 +23,16 @@ SILENT = @
endif
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
-OUTPUT=$(MKPLATBOOT).exe
+OUTPUT=mktccboot.exe
CFLAGS+=-mno-cygwin
else
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
-OUTPUT=$(MKPLATBOOT).exe
+OUTPUT=mktccboot.exe
else
ifeq ($(findstring mingw,$(CC)),mingw)
-OUTPUT=$(MKPLATBOOT).exe
+OUTPUT=mktccboot.exe
else
-OUTPUT=$(MKPLATBOOT)
+OUTPUT=mktccboot
endif
endif
endif
@@ -47,71 +43,63 @@ endif
OUT = $(TARGET_DIR)build$(RBARCH)
-MKPLATBOOT_OBJ=$(OUT)/$(MKPLATBOOT).o
-LIBMKPLATBOOT_OBJ=$(OUT)/$(LIB_MKPLATBOOT).o
-
all: $(OUTPUT)
-# Dependant modules
-TELECHIPS=$(TOOLSDIR)/telechips
-TELECHIPS_OBJ=$(TELECHIPS).o
-
-$(TELECHIPS_OBJ): $(TELECHIPS).[ch]
+$(TOOLSDIR)/telechips.o: $(TOOLSDIR)/telechips.[ch]
make -C $(TOOLSDIR) $(TARGET_DIR)telechips.o
-DEPENDANT_OBJS=$(TELECHIPS_OBJ)
-
-$(MKPLATBOOT_OBJ): $(MKPLATBOOT).[ch] $(DEPENDANT_OBJS)
+$(OUT)/mktccboot.o: mktccboot.[ch] $(TOOLSDIR)/telechips.o
@echo CC $<
- $(SILENT)$(CC) $(CFLAGS) -c -o $(MKPLATBOOT_OBJ) -W -Wall $(MKPLATBOOT).c -DVERSION=\"$(APPVERSION)\"
+ $(SILENT)$(CC) $(CFLAGS) -c -o $(OUT)/mktccboot.o -W -Wall mktccboot.c -DVERSION=\"$(APPVERSION)\"
-$(OUTPUT): $(OUT) $(MKPLATBOOT_OBJ)
+$(OUTPUT): $(OUT) $(OUT)/mktccboot.o
@echo CC $<
- $(SILENT)$(CC) $(CFLAGS) -o $(OUTPUT) $(MKPLATBOOT_OBJ) $(DEPENDANT_OBJS)
+ $(SILENT)$(CC) $(CFLAGS) -o $(OUTPUT) $(OUT)/mktccboot.o $(TOOLSDIR)/telechips.o
-$(LIBMKPLATBOOT_OBJ): $(MKPLATBOOT_OBJ)
+$(OUT)/libmktccboot.o: $(OUT)/mktccboot.o
@echo CC $<
- $(SILENT)$(CC) $(CFLAGS) -DLIB -c -o $(LIBMKPLATBOOT_OBJ) -W -Wall $(MKPLATBOOT).c
+ $(SILENT)$(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmktccboot.o -W -Wall mktccboot.c
-$(LIB_MKPLATBOOT)$(RBARCH).a: $(OUT) $(LIBMKPLATBOOT_OBJ)
+libmktccboot$(RBARCH).a: $(OUT) $(OUT)/libmktccboot.o
@echo AR $@
- $(SILENT)$(AR) ruc $(TARGET_DIR)$(LIB_MKPLATBOOT)$(RBARCH).a $(LIBMKPLATBOOT_OBJ)
+ $(SILENT)$(AR) ruc $(TARGET_DIR)libmktccboot$(RBARCH).a $(OUT)/libmktccboot.o
# some trickery to build ppc and i386 from a single call
ifeq ($(RBARCH),)
-$(LIB_MKPLATBOOT)i386.a:
- make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) $(LIB_MKPLATBOOT)i386.a
+libmktccbooti386.a:
+ make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libmktccbooti386.a
-$(LIB_MKPLATBOOT)ppc.a:
- make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) $(LIB_MKPLATBOOT)ppc.a
+libmktccbootppc.a:
+ make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libmktccbootppc.a
endif
-$(LIB_MKPLATBOOT)-universal: $(LIB_MKPLATBOOT)i386.a $(LIB_MKPLATBOOT)ppc.a
- @echo lipo $(TARGET_DIR)$(LIB_MKPLATBOOT).a
- $(SILENT) rm -f $(TARGET_DIR)$(LIB_MKPLATBOOT).a
- lipo -create $(TARGET_DIR)$(LIB_MKPLATBOOT)ppc.a $(TARGET_DIR)$(LIB_MKPLATBOOT)i386.a -output $(TARGET_DIR)$(LIB_MKPLATBOOT).a
+libmktccboot-universal: libmktccbooti386.a libmktccbootppc.a
+ @echo lipo $(TARGET_DIR)libmktccboot.a
+ $(SILENT) rm -f $(TARGET_DIR)libmktccboot.a
+ lipo -create $(TARGET_DIR)libmktccbootppc.a $(TARGET_DIR)libmktccbooti386.a -output $(TARGET_DIR)libmktccboot.a
clean:
- rm -f $(OUTPUT) $(LIB_MKPLATBOOT).o $(TARGET_DIR)$(LIB_MKPLATBOOT)*.a $(MKPLATBOOT).dmg
- rm -f $(DEPENDANT_OBJS)
- rm -rf build* $(MKPLATBOOT)-*
+ rm -f $(OUTPUT) libmktccboot.o $(TARGET_DIR)libmktccboot*.a mktccboot.dmg
+ rm -f $(TOOLSDIR)/telechips.o
+ rm -rf build* mktccboot-*
-$(MKPLATBOOT)-i386:
+mktccboot-i386:
$(MAKE) RBARCH=i386
- mv $(MKPLATBOOT) $(MKPLATBOOT)-i386
+ mv mktccboot mktccboot-i386
-$(MKPLATBOOT)-ppc:
+mktccboot-ppc:
make RBARCH=ppc
- mv $(MKPLATBOOT) $(MKPLATBOOT)-ppc
+ mv mktccboot mktccboot-ppc
-$(MKPLATBOOT)-mac: $(MKPLATBOOT)-i386 $(MKPLATBOOT)-ppc
- lipo -create $(MKPLATBOOT)-ppc $(MKPLATBOOT)-i386 -output $(MKPLATBOOT)-mac
+mktccboot-mac: mktccboot-i386 mktccboot-ppc
+ lipo -create mktccboot-ppc mktccboot-i386 -output mktccboot-mac
-$(MKPLATBOOT).dmg: $(MKPLATBOOT)-mac
- mkdir -p $(MKPLATBOOT)-dmg
- cp -p $(MKPLATBOOT)-mac $(MKPLATBOOT)-dmg
- hdiutil create -srcfolder $(MKPLATBOOT)-dmg $(MKPLATBOOT).dmg
+mktccboot.dmg: mktccboot-mac
+ mkdir -p mktccboot-dmg
+ cp -p mktccboot-mac mktccboot-dmg
+ hdiutil create -srcfolder mktccboot-dmg mktccboot.dmg
$(OUT):
@echo MKDIR $(OUT)
$(SILENT)mkdir $(OUT)
+