Mercurial > hg > index.fcgi > lj > lj046
diff gbamakefile @ 0:c84446dfb3f5
initial add
author | paulo@localhost |
---|---|
date | Fri, 13 Mar 2009 00:39:12 -0700 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gbamakefile Fri Mar 13 00:39:12 2009 -0700 1.3 @@ -0,0 +1,135 @@ 1.4 +# Makefile for Game Boy Advance version of LOCKJAW 1.5 +# 1.6 +# Copr. 2006-2007 Damian Yerrick 1.7 +# 1.8 +# This work is free software; you can redistribute it and/or modify 1.9 +# it under the terms of the GNU General Public License as published by 1.10 +# the Free Software Foundation; either version 2 of the License, or 1.11 +# (at your option) any later version. 1.12 +# 1.13 +# This program is distributed in the hope that it will be useful, 1.14 +# but WITHOUT ANY WARRANTY; without even the implied warranty of 1.15 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.16 +# GNU General Public License for more details. 1.17 +# 1.18 +# You should have received a copy of the GNU General Public License 1.19 +# along with this program; if not, write to the Free Software 1.20 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1.21 + 1.22 + 1.23 +srcdir := src 1.24 +objdir := obj/gba 1.25 +EXE := $(objdir)/lj.elf 1.26 +ASSETSFILE := $(objdir)/assets.s 1.27 +INCGBA := -I$(DEVKITPRO)/libgba/include 1.28 +LIBGBA := -L$(DEVKITPRO)/libgba/lib -lgba 1.29 +THUMB_CFLAGS := -mthumb -Wall -O2 -std=gnu99 -mcpu=arm7tdmi \ 1.30 +-DFONTDRAW_SPLIT_COMPILE -DNO_DATETIME -DDEBRIEF_SHORT 1.31 +ARM_CFLAGS := -marm -Wall -O2 -std=gnu99 -mcpu=arm7tdmi \ 1.32 +-DFONTDRAW_SPLIT_COMPILE 1.33 +CC := arm-eabi-gcc -mthumb-interwork 1.34 +LD := arm-eabi-gcc -mthumb-interwork 1.35 +LDFLAGS := -mthumb -Wall -specs=gba_mb.specs 1.36 + 1.37 +MUSICOBJS := $(objdir)/gbasound.o $(objdir)/gbanotefreq.o 1.38 +MUSICLIBS := 1.39 + 1.40 +# The wintermute-approved way to ensure devkitARM is in the PATH 1.41 +ifeq ($(strip $(DEVKITPRO)),) 1.42 +$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro) 1.43 +endif 1.44 +ifeq ($(strip $(DEVKITARM)),) 1.45 +$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM) 1.46 +endif 1.47 +export PATH := $(DEVKITARM)/bin:$(PATH) 1.48 + 1.49 +# Objects 1.50 + 1.51 +LDLIBS := $(LIBGBA) 1.52 +DEPOBJS := \ 1.53 +$(objdir)/ljgba.o $(objdir)/gbaopt.o $(objdir)/gbaisr.iwram.o \ 1.54 +$(objdir)/ljplay.o $(objdir)/lj.o $(objdir)/speed.o $(objdir)/gimmicks.o \ 1.55 +$(objdir)/options.o $(objdir)/wktables.o $(objdir)/fontdraw.o \ 1.56 +$(objdir)/fontdraw.iwram.o $(objdir)/macro.o $(objdir)/random.o \ 1.57 +$(objdir)/gba_asm.o $(objdir)/ljlocale.o $(objdir)/debrief.o \ 1.58 +$(objdir)/dsdebrief.o $(objdir)/gbamenus.o $(objdir)/dsjoy.o \ 1.59 +$(MUSICOBJS) 1.60 +ASSETS := $(srcdir)/text.chr $(srcdir)/gbablk.chr $(objdir)/vwfont.bin 1.61 +#deleted: ljpc pcjoy options debrief ljreplay ljmusic 1.62 + 1.63 +OTHEROBJS := $(ASSETSFILE) 1.64 + 1.65 +run: lj.gba 1.66 + start $< 1.67 + 1.68 +#ejector is at http://jimprice.com/jim-soft.shtml#eject 1.69 +#and is not necessary for building the program 1.70 +cf: lj.gba 1.71 + cp lj.gba /h/gba/ 1.72 + ejector H: 1.73 + 1.74 +$(EXE): $(DEPOBJS) $(OTHEROBJS) 1.75 + $(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LDLIBS) -o $@ 1.76 + 1.77 +$(ASSETSFILE): $(ASSETS) 1.78 + bin2s $^ > $@ 1.79 + 1.80 +# Compilation rules 1.81 + 1.82 +%.gba: $(objdir)/%.elf 1.83 + arm-eabi-objcopy -O binary $< $@ 1.84 + gbafix -tLOCKJAW $@ 1.85 + 1.86 +$(objdir)/%.iwram.o: $(srcdir)/%.iwram.c 1.87 + $(CC) $(ARM_CFLAGS) -MMD -c -o $@ $< $(INCGBA) 1.88 + @cp $(objdir)/$*.iwram.d $(objdir)/$*.iwram.P; \ 1.89 + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ 1.90 + -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.iwram.d >> $(objdir)/$*.iwram.P; \ 1.91 + rm -f $(objdir)/$*.iwram.d 1.92 + 1.93 +$(objdir)/%.o: $(srcdir)/%.c 1.94 + $(CC) $(THUMB_CFLAGS) -MMD -c -o $@ $< $(INCGBA) 1.95 + @cp $(objdir)/$*.d $(objdir)/$*.P; \ 1.96 + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ 1.97 + -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \ 1.98 + rm -f $(objdir)/$*.d 1.99 + 1.100 +$(objdir)/%.o: $(srcdir)/%.s 1.101 + $(CC) -MMD -c -o $@ $< $(INCGBA) 1.102 + @cp $(objdir)/$*.d $(objdir)/$*.P; \ 1.103 + sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ 1.104 + -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \ 1.105 + rm -f $(objdir)/$*.d 1.106 + 1.107 +$(objdir)/%.o: $(objdir)/%.s 1.108 + $(CC) -c -o $@ $< 1.109 + 1.110 +# The master copy of the variable width font library is in another folder 1.111 + 1.112 +src/fontdraw%: /e/games/ac/double/rac/src/fontdraw% 1.113 + cp $< $@ 1.114 + 1.115 +src/font.bmp: /e/games/ac/double/rac/src/font.bmp 1.116 + cp $< $@ 1.117 + 1.118 +$(objdir)/vwfont.bin: tools/fontconv.exe $(srcdir)/font.bmp 1.119 + $^ $@ 1.120 + 1.121 +tools/fontconv.exe: tools/fontconv.o 1.122 + gcc -Wall -s $^ -lalleg -o $@ 1.123 + 1.124 +tools/%.o: tools/%.c 1.125 + gcc -Wall -O2 -std=gnu99 -c $< -o $@ 1.126 + 1.127 +# Header dependencies 1.128 + 1.129 +-include $(DEPOBJS:%.o=%.P) 1.130 + 1.131 + 1.132 +# Cleanup rules 1.133 +.PHONY: clean run cf 1.134 + 1.135 +clean: 1.136 + -rm $(objdir)/*.s 1.137 + -rm $(objdir)/*.o 1.138 + -rm $(objdir)/*.P