diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-11-04 21:56:40 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-11-04 21:56:40 +0000 |
commit | 20f3e646d8d5f41f009493ee8b193dd75436afbc (patch) | |
tree | 147c0fb8a7f957b49bcc3e79f640776686617a06 /rbutil/mktccboot/Makefile | |
parent | e9c900d09de17eb4367a607b723b77e7228d3cee (diff) | |
download | rockbox-20f3e646d8d5f41f009493ee8b193dd75436afbc.tar.gz rockbox-20f3e646d8d5f41f009493ee8b193dd75436afbc.zip |
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
Diffstat (limited to 'rbutil/mktccboot/Makefile')
-rw-r--r-- | rbutil/mktccboot/Makefile | 35 |
1 files changed, 22 insertions, 13 deletions
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) | |||
45 | 45 | ||
46 | all: $(OUTPUT) | 46 | all: $(OUTPUT) |
47 | 47 | ||
48 | $(OUT)/telechips.o: $(TOOLSDIR)/telechips.[ch] | 48 | # inputs |
49 | LIBSOURCES := mktccboot.c $(TOOLSDIR)/telechips.o | ||
50 | SOURCES := $(LIBSOURCES) main.c | ||
51 | OBJS := $(patsubst %.c,%.o,$(addprefix $(OUT)/,$(notdir $(SOURCES)))) | ||
52 | LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OUT)/,$(notdir $(LIBSOURCES)))) | ||
53 | EXTRADEPS := | ||
54 | |||
55 | # rule for sources from tools dir | ||
56 | $(OUT)/%.o: $(TOOLSDIR)/%.c $(OUT) | ||
49 | @echo CC $< | 57 | @echo CC $< |
50 | $(SILENT)$(CC) $(CFLAGS) -c -o $(OUT)/telechips.o $(TOOLSDIR)/telechips.c | 58 | $(SILENT)$(CC) $(CFLAGS) -c -o $@ $< |
51 | 59 | ||
52 | $(OUT)/mktccboot.o: mktccboot.[ch] $(OUT)/telechips.o | 60 | $(OUT)/%.o: %.c $(OUT) |
53 | @echo CC $< | 61 | @echo CC $< |
54 | $(SILENT)$(CC) $(CFLAGS) -c -o $(OUT)/mktccboot.o -W -Wall mktccboot.c -DVERSION=\"$(APPVERSION)\" | 62 | $(SILENT)$(CC) $(CFLAGS) -c -o $@ $< |
55 | |||
56 | $(OUTPUT): $(OUT) $(OUT)/mktccboot.o | ||
57 | @echo LD $@ | ||
58 | $(SILENT)$(CC) $(CFLAGS) -o $(OUTPUT) $(OUT)/mktccboot.o $(OUT)/telechips.o | ||
59 | 63 | ||
64 | # building the library archive | ||
60 | $(OUT)/libmktccboot.o: $(OUT)/mktccboot.o | 65 | $(OUT)/libmktccboot.o: $(OUT)/mktccboot.o |
61 | @echo CC $< | 66 | @echo CC $< |
62 | $(SILENT)$(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmktccboot.o -W -Wall mktccboot.c | 67 | $(SILENT)$(CC) $(CFLAGS) -DLIB -c -o $(OUT)/libmktccboot.o -W -Wall mktccboot.c |
63 | 68 | ||
64 | libmktccboot$(RBARCH).a: $(OUT) $(OUT)/libmktccboot.o | 69 | libmktccboot$(RBARCH).a: $(LIBOBJS) |
65 | @echo AR $@ | 70 | @echo AR $@ |
66 | $(SILENT)$(AR) ruc $(TARGET_DIR)libmktccboot$(RBARCH).a $(OUT)/libmktccboot.o | 71 | $(SILENT)$(AR) ruc $(TARGET_DIR)$@ $^ |
72 | |||
73 | # building the standalone executable | ||
74 | $(OUTPUT): $(OBJS) $(EXTRADEPS) | ||
75 | @echo LD $@ | ||
76 | $(SILENT)$(CC) $(CFLAGS) -o$(OUTPUT) $(OBJS) $(EXTRADEPS) | ||
67 | 77 | ||
68 | # some trickery to build ppc and i386 from a single call | 78 | # some trickery to build ppc and i386 from a single call |
69 | ifeq ($(RBARCH),) | 79 | ifeq ($(RBARCH),) |
@@ -80,9 +90,8 @@ libmktccboot-universal: libmktccbooti386.a libmktccbootppc.a | |||
80 | lipo -create $(TARGET_DIR)libmktccbootppc.a $(TARGET_DIR)libmktccbooti386.a -output $(TARGET_DIR)libmktccboot.a | 90 | lipo -create $(TARGET_DIR)libmktccbootppc.a $(TARGET_DIR)libmktccbooti386.a -output $(TARGET_DIR)libmktccboot.a |
81 | 91 | ||
82 | clean: | 92 | clean: |
83 | rm -f $(OUTPUT) libmktccboot.o $(TARGET_DIR)libmktccboot*.a mktccboot.dmg | 93 | rm -f $(OUTPUT) $(TARGET_DIR)libmktccboot*.a mktccboot.dmg |
84 | rm -f $(TOOLSDIR)/telechips.o | 94 | rm -rf $(OUT) |
85 | rm -rf build* mktccboot-* | ||
86 | 95 | ||
87 | mktccboot-i386: | 96 | mktccboot-i386: |
88 | $(MAKE) RBARCH=i386 | 97 | $(MAKE) RBARCH=i386 |