mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
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
This commit is contained in:
parent
e9c900d09d
commit
20f3e646d8
5 changed files with 160 additions and 116 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue