aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNebuleon Fumika2012-12-17 19:55:41 -0500
committerNebuleon Fumika2012-12-17 19:55:41 -0500
commit43bcd26dca5a747953e3a3083d4d4b4bad8e1c7c (patch)
treece771200ae95b0b0e418d4c73c8fe70d2847884d /Makefile
parenta9ebbd3e72e15ca8098b576fdeb49bb41a54b0e6 (diff)
downloadsnesemu-43bcd26dca5a747953e3a3083d4d4b4bad8e1c7c.tar.gz
snesemu-43bcd26dca5a747953e3a3083d4d4b4bad8e1c7c.tar.bz2
snesemu-43bcd26dca5a747953e3a3083d4d4b4bad8e1c7c.zip
Optimise for size. Allow the build process to use multiple CPU cores with make -jN.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 14 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 15964c3..cc24000 100644
--- a/Makefile
+++ b/Makefile
@@ -18,12 +18,11 @@ export OUTPUT := $(CURDIR)/$(TARGET)
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
- @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
+ $(MAKE) -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
- @echo clean ...
- @rm -fr $(BUILD) $(OUTPUT).plg
+ rm -fr $(BUILD) $(OUTPUT).plg
#---------------------------------------------------------------------------------
@@ -59,8 +58,8 @@ EXTLIBS := $(DS2SDKPATH)/lib/libds2a.a
INC := -I$(DS2SDKPATH)/include -I$(FS_DIR) -I$(CONSOLE_DIR) -I$(KEY_DIR) -I$(ZLIB_DIR)
-CFLAGS := -mips32 -O3 -mno-abicalls -fno-pic -fno-builtin \
- -fno-exceptions -ffunction-sections -mlong-calls\
+CFLAGS := -mips32 -Os -mno-abicalls -fno-pic -fno-builtin \
+ -fno-exceptions -fno-function-sections -mlong-calls\
-fomit-frame-pointer -msoft-float -G 4
@@ -83,11 +82,12 @@ APP := sfc.elf
all: $(APP)
@echo $(INC)
- $(OBJCOPY) -O binary $(APP) sfc.dat
- $(OBJDUMP) -d $(APP) > sfc.dump
- $(NM) $(APP) | sort > sfc.sym
- $(OBJDUMP) -h $(APP) > sfc.map
+ $(OBJCOPY) -x -O binary $(APP) sfc.dat
$(DS2SDKPATH)/tools/makeplug sfc.dat $(OUTPUT).plg
+# but also, if you want to debug even more
+# $(OBJDUMP) -d $(APP) > sfc.dump
+# $(NM) $(APP) | sort > sfc.sym
+# $(OBJDUMP) -h $(APP) > sfc.map
$(APP): depend $(SOBJS) $(OBJS) $(STARTO) $(LINKS) $(EXTLIBS)
$(CC) -nostdlib -static -T $(LINKS) -o $@ $(STARTO) $(SOBJS) $(OBJS) $(EXTLIBS) $(LIBS)
@@ -111,10 +111,13 @@ clean:
# depend: Makefile $(OBJS:.o=.c) $(SOBJS:.o=.S)
-depend: Makefile
+Makefile: depend
+ touch $@
+
+depend: $(SSRC) $(SRC)
$(CC) -MM $(CFLAGS) $(INC) $(SSRC) $(SRC) > $@
-sinclude depend
+-include depend
#1-1----------------------------------------------------------------------------
endif