diff options
-rw-r--r-- | rbutil/libtools.make | 25 | ||||
-rw-r--r-- | rbutil/mkmpioboot/Makefile | 98 |
2 files changed, 25 insertions, 98 deletions
diff --git a/rbutil/libtools.make b/rbutil/libtools.make index 1e5a297f79..d9ead7072d 100644 --- a/rbutil/libtools.make +++ b/rbutil/libtools.make | |||
@@ -58,11 +58,28 @@ all: $(BINARY) | |||
58 | OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(notdir $(SOURCES)))) | 58 | OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(notdir $(SOURCES)))) |
59 | LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(notdir $(LIBSOURCES)))) | 59 | LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(notdir $(LIBSOURCES)))) |
60 | 60 | ||
61 | # additional link dependencies for the standalone executable | ||
62 | # extra dependencies: libucl | ||
63 | LIBUCL = libucl$(RBARCH).a | ||
64 | $(LIBUCL): $(OBJDIR)$(LIBUCL) | ||
65 | |||
66 | $(OBJDIR)$(LIBUCL): | ||
67 | $(SILENT)$(MAKE) -C $(TOP)/../tools/ucl/src TARGET_DIR=$(OBJDIR) $@ | ||
68 | |||
69 | # building the standalone executable | ||
70 | $(BINARY): $(OBJS) $(EXTRADEPS) $(addprefix $(OBJDIR),$(EXTRALIBOBJS)) | ||
71 | @echo LD $@ | ||
72 | # $(SILENT)mkdir -p $(dir $@) | ||
73 | # EXTRADEPS need to be built into OBJDIR. | ||
74 | $(SILENT)$(CROSS)$(CC) $(CFLAGS) -o $(BINARY) $(OBJS) $(addprefix $(OBJDIR),$(EXTRADEPS)) $(addprefix $(OBJDIR),$(EXTRALIBOBJS)) | ||
75 | |||
76 | # common rules | ||
61 | $(OBJDIR)%.o: %.c | 77 | $(OBJDIR)%.o: %.c |
62 | @echo CC $< | 78 | @echo CC $< |
63 | $(SILENT)mkdir -p $(dir $@) | 79 | $(SILENT)mkdir -p $(dir $@) |
64 | $(SILENT)$(CROSS)$(CC) $(CFLAGS) -c -o $@ $< | 80 | $(SILENT)$(CROSS)$(CC) $(CFLAGS) -c -o $@ $< |
65 | 81 | ||
82 | # lib rules | ||
66 | lib$(OUTPUT)$(RBARCH).a: $(TARGET_DIR)lib$(OUTPUT)$(RBARCH).a | 83 | lib$(OUTPUT)$(RBARCH).a: $(TARGET_DIR)lib$(OUTPUT)$(RBARCH).a |
67 | lib$(OUTPUT)$(RBARCH): $(TARGET_DIR)lib$(OUTPUT)$(RBARCH).a | 84 | lib$(OUTPUT)$(RBARCH): $(TARGET_DIR)lib$(OUTPUT)$(RBARCH).a |
68 | 85 | ||
@@ -71,14 +88,6 @@ $(TARGET_DIR)lib$(OUTPUT)$(RBARCH).a: $(LIBOBJS) $(addprefix $(OBJDIR),$(EXTRALI | |||
71 | $(SILENT)mkdir -p $(dir $@) | 88 | $(SILENT)mkdir -p $(dir $@) |
72 | $(SILENT)$(AR) rucs $@ $^ | 89 | $(SILENT)$(AR) rucs $@ $^ |
73 | 90 | ||
74 | |||
75 | # building the standalone executable | ||
76 | $(BINARY): $(OBJS) $(EXTRADEPS) $(addprefix $(OBJDIR),$(EXTRALIBOBJS)) | ||
77 | @echo LD $@ | ||
78 | # $(SILENT)mkdir -p $(dir $@) | ||
79 | # EXTRADEPS need to be built into OBJDIR. | ||
80 | $(SILENT)$(CROSS)$(CC) $(CFLAGS) -o $(BINARY) $(OBJS) $(addprefix $(OBJDIR),$(EXTRADEPS)) $(addprefix $(OBJDIR),$(EXTRALIBOBJS)) | ||
81 | |||
82 | # some trickery to build ppc and i386 from a single call | 91 | # some trickery to build ppc and i386 from a single call |
83 | ifeq ($(RBARCH),) | 92 | ifeq ($(RBARCH),) |
84 | $(TARGET_DIR)lib$(OUTPUT)i386.a: | 93 | $(TARGET_DIR)lib$(OUTPUT)i386.a: |
diff --git a/rbutil/mkmpioboot/Makefile b/rbutil/mkmpioboot/Makefile index 8077bdceb6..8b560d6b29 100644 --- a/rbutil/mkmpioboot/Makefile +++ b/rbutil/mkmpioboot/Makefile | |||
@@ -5,101 +5,19 @@ | |||
5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 5 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
6 | # \/ \/ \/ \/ \/ | 6 | # \/ \/ \/ \/ \/ |
7 | 7 | ||
8 | #change for releases | 8 | TARGET_DIR ?= $(shell pwd)/ |
9 | ifndef APPVERSION | ||
10 | APPVERSION=`../../tools/version.sh ../../` | ||
11 | endif | ||
12 | |||
13 | # We use the UCL code available in the Rockbox tools/ directory | 9 | # We use the UCL code available in the Rockbox tools/ directory |
14 | CFLAGS=-I../../tools/ucl/include -Wall -DVERSION=\"$(APPVERSION)\" | 10 | CFLAGS = -I../../tools/ucl/include -Wall |
15 | |||
16 | ifndef V | ||
17 | SILENT = @ | ||
18 | endif | ||
19 | |||
20 | ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN) | ||
21 | OUTPUT=mkmpioboot.exe | ||
22 | CFLAGS+=-mno-cygwin | ||
23 | else | ||
24 | ifeq ($(findstring MINGW,$(shell uname)),MINGW) | ||
25 | OUTPUT=mkmpioboot.exe | ||
26 | else | ||
27 | ifeq ($(findstring mingw,$(CC)),mingw) | ||
28 | OUTPUT=mkmpioboot.exe | ||
29 | else | ||
30 | OUTPUT=mkmpioboot | ||
31 | endif | ||
32 | endif | ||
33 | endif | ||
34 | |||
35 | ifdef RBARCH | ||
36 | CFLAGS += -arch $(RBARCH) | ||
37 | OBJDIR = $(TARGET_DIR)build/$(RBARCH)/ | ||
38 | else | ||
39 | OBJDIR = $(TARGET_DIR)build/ | ||
40 | endif | ||
41 | |||
42 | TARGET_DIR ?= $(shell pwd) | ||
43 | 11 | ||
44 | all: $(OUTPUT) | 12 | OUTPUT = mkmpioboot |
45 | 13 | ||
46 | # inputs | 14 | # inputs |
47 | LIBSOURCES := mkmpioboot.c | 15 | LIBSOURCES = mkmpioboot.c |
48 | SOURCES := $(LIBSOURCES) main.c | 16 | SOURCES = $(LIBSOURCES) main.c |
49 | OBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(SOURCES))) | 17 | EXTRADEPS = $(LIBUCL) |
50 | LIBOBJS := $(patsubst %.c,%.o,$(addprefix $(OBJDIR),$(LIBSOURCES))) | 18 | |
51 | EXTRADEPS := $(LIBUCL) | 19 | include ../libtools.make |
52 | 20 | ||
53 | # explicit dependencies | 21 | # explicit dependencies |
54 | $(OBJDIR)mkmpioboot.o: mkmpioboot.c mkmpioboot.h | 22 | $(OBJDIR)mkmpioboot.o: mkmpioboot.c mkmpioboot.h |
55 | $(OBJDIR)main.o: main.c | ||
56 | |||
57 | $(OBJDIR)%.o: %.c | ||
58 | @echo CC $< $ | ||
59 | $(SILENT)mkdir -p $(dir $@) | ||
60 | $(SILENT)$(CC) $(CFLAGS) -c -o $@ $< | ||
61 | |||
62 | libmkmpioboot$(RBARCH).a: $(TARGET_DIR)libmkmpioboot$(RBARCH).a | ||
63 | |||
64 | $(TARGET_DIR)libmkmpioboot$(RBARCH).a: $(LIBOBJS) | ||
65 | @echo AR $(notdir $@) | ||
66 | $(SILENT)$(AR) rucs $@ $^ | ||
67 | |||
68 | # building the standalone executable | ||
69 | $(OUTPUT): $(OBJS) $(EXTRADEPS) | ||
70 | @echo LD $@ | ||
71 | $(SILENT)$(CC) $(CFLAGS) -o $(OUTPUT) $(OBJS) $(EXTRADEPS) | ||
72 | |||
73 | # some trickery to build ppc and i386 from a single call | ||
74 | ifeq ($(RBARCH),) | ||
75 | $(TARGET_DIR)libmkmpiobooti386.a: | ||
76 | make RBARCH=i386 TARGET_DIR=$(TARGET_DIR) libmkmpiobooti386.a | ||
77 | |||
78 | $(TARGET_DIR)libmkmpiobootppc.a: | ||
79 | make RBARCH=ppc TARGET_DIR=$(TARGET_DIR) libmkmpiobootppc.a | ||
80 | endif | ||
81 | |||
82 | libmkmpioboot-universal: $(TARGET_DIR)libmkmpiobooti386.a $(TARGET_DIR)libmkmpiobootppc.a | ||
83 | @echo lipo $(TARGET_DIR)libmkmpioboot.a | ||
84 | $(SILENT) rm -f $(TARGET_DIR)libmkmpioboot.a | ||
85 | $(SILENT)lipo -create $(TARGET_DIR)libmkmpiobootppc.a $(TARGET_DIR)libmkmpiobooti386.a -output $(TARGET_DIR)libmkmpioboot.a | ||
86 | |||
87 | clean: | ||
88 | rm -f $(OBJS) $(OUTPUT) $(TARGET_DIR)libmkmpioboot*.a mkmpioboot.dmg | ||
89 | rm -rf mkmpioboot-* i386 ppc $(OBJDIR) | ||
90 | |||
91 | mkmpioboot-i386: | ||
92 | $(MAKE) RBARCH=i386 | ||
93 | mv mkmpioboot mkmpioboot-i386 | ||
94 | |||
95 | mkmpioboot-ppc: | ||
96 | $(MAKE) RBARCH=ppc | ||
97 | mv mkmpioboot mkmpioboot-ppc | ||
98 | |||
99 | mkmpioboot-mac: mkmpioboot-i386 mkmpioboot-ppc | ||
100 | $(SILENT)lipo -create mkmpioboot-ppc mkmpioboot-i386 -output mkmpioboot-mac | ||
101 | 23 | ||
102 | mkmpioboot.dmg: mkmpioboot-mac | ||
103 | mkdir -p mkmpioboot-dmg | ||
104 | cp -p mkmpioboot-mac mkmpioboot-dmg | ||
105 | hdiutil create -srcfolder mkmpioboot-dmg mkmpioboot.dmg | ||