Mercurial > hg > index.fcgi > lj > lj046-2players
comparison dsmakefile @ 0:c84446dfb3f5
initial add
author | paulo@localhost |
---|---|
date | Fri, 13 Mar 2009 00:39:12 -0700 |
parents | |
children | 38c62fded078 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9d0825c657fb |
---|---|
1 # Makefile for Nintendo DS version of LOCKJAW | |
2 # | |
3 # Copr. 2006-2007 Damian Yerrick | |
4 # | |
5 # This work is free software; you can redistribute it and/or modify | |
6 # it under the terms of the GNU General Public License as published by | |
7 # the Free Software Foundation; either version 2 of the License, or | |
8 # (at your option) any later version. | |
9 # | |
10 # This program is distributed in the hope that it will be useful, | |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 # GNU General Public License for more details. | |
14 # | |
15 # You should have received a copy of the GNU General Public License | |
16 # along with this program; if not, write to the Free Software | |
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 srcdir := src | |
20 objdir := obj/ds | |
21 EXE := $(objdir)/ljds.elf | |
22 EXE7 := $(objdir)/ljds7.elf | |
23 ASSETSFILE := $(objdir)/assets.s | |
24 ASSETS := $(srcdir)/text.chr $(srcdir)/gbablk.chr $(objdir)/vwfont.bin | |
25 ARMGCC=arm-eabi-gcc | |
26 ARMOBJ=arm-eabi-objcopy | |
27 CFLAGS7=-std=gnu99 -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork | |
28 CFLAGS9=-std=gnu99 -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb-interwork -DDEBRIEF_SHORT -DHAS_FOPEN | |
29 LDLIBS9=-lfat -lnds9 | |
30 NDSLIB_INCLUDE=$(DEVKITPRO)/libnds/include | |
31 NDSLIB_LIB=$(DEVKITPRO)/libnds/lib | |
32 DEPOBJS := \ | |
33 $(objdir)/ljds.o $(objdir)/ljplay.o $(objdir)/lj.o \ | |
34 $(objdir)/gimmicks.o $(objdir)/wktables.o $(objdir)/macro.o \ | |
35 $(objdir)/gbaopt.o $(objdir)/speed.o $(objdir)/options.o \ | |
36 $(objdir)/fontdraw.o $(objdir)/dssleep.o $(objdir)/random.o \ | |
37 $(objdir)/ljlocale.o $(objdir)/debrief.o $(objdir)/dsdebrief.o \ | |
38 $(objdir)/gbamenus.o $(objdir)/ljpath.o $(objdir)/dsjoy.o | |
39 OBJS := $(DEPOBJS) $(ASSETSFILE) | |
40 EMU := start | |
41 GAMEICON := docs/dsicon.bmp | |
42 | |
43 CC := gcc | |
44 CFLAGS := | |
45 | |
46 # The wintermute-approved way to ensure devkitARM is in the PATH | |
47 ifeq ($(strip $(DEVKITPRO)),) | |
48 $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro) | |
49 endif | |
50 ifeq ($(strip $(DEVKITARM)),) | |
51 $(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM) | |
52 endif | |
53 export PATH := $(DEVKITARM)/bin:$(PATH) | |
54 | |
55 .PHONY: run clean cf | |
56 | |
57 run: lj.nds | |
58 $(EMU) $< | |
59 | |
60 lj.nds: $(objdir)/ljds.bin $(objdir)/ljds7.bin $(GAMEICON) | |
61 ndstool -c $@ -9 $(objdir)/ljds.bin -7 $(objdir)/ljds7.bin -b $(GAMEICON) "LOCKJAW DS;The Soviet Mind Game" | |
62 | |
63 %.nds.gba: %.nds | |
64 dsbuild $< -o $@ | |
65 | |
66 %.bin: %.elf | |
67 $(ARMOBJ) -O binary $< $@ | |
68 | |
69 $(EXE): $(OBJS) | |
70 $(ARMGCC) -g -mthumb-interwork -mno-fpu -specs=ds_arm9.specs $^ -L$(NDSLIB_LIB) $(LDLIBS9) -o $@ | |
71 | |
72 $(objdir)/ljds7.elf: $(objdir)/dsarm7.o $(objdir)/lookup_tables7.o $(objdir)/dssound7.o | |
73 $(ARMGCC) -g -mthumb-interwork -mno-fpu -specs=ds_arm7.specs $^ -L$(NDSLIB_LIB) -lnds7 -o $@ | |
74 | |
75 $(objdir)/%7.o: $(srcdir)/%7.c | |
76 $(ARMGCC) $(CFLAGS7) -I$(NDSLIB_INCLUDE) -MMD -DARM7 -c $< -o $@ | |
77 @cp $(objdir)/$*.d $(objdir)/$*.P; \ | |
78 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ | |
79 -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \ | |
80 rm -f $(objdir)/$*.d | |
81 | |
82 $(objdir)/%.o: $(srcdir)/%.c $(srcdir)/ljds.h | |
83 $(ARMGCC) $(CFLAGS9) -I$(NDSLIB_INCLUDE) -MMD -DARM9 -c $< -o $@ | |
84 @cp $(objdir)/$*.d $(objdir)/$*.P; \ | |
85 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ | |
86 -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \ | |
87 rm -f $(objdir)/$*.d | |
88 | |
89 %.o: %.s | |
90 $(ARMGCC) $(CFLAGS9) -I$(NDSLIB_INCLUDE) -MMD -DARM9 -c $< -o $@ | |
91 @cp $(objdir)/$*.d $(objdir)/$*.P; \ | |
92 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ | |
93 -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \ | |
94 rm -f $(objdir)/$*.d | |
95 | |
96 $(ASSETSFILE): $(ASSETS) | |
97 bin2s $^ > $@ | |
98 | |
99 # Handle header dependencies | |
100 | |
101 -include $(DEPOBJS:%.o=%.P) | |
102 # The master copy of the variable width font library is in another folder | |
103 | |
104 src/fontdraw%: /e/games/ac/double/rac/src/fontdraw% | |
105 cp $< $@ | |
106 | |
107 #ejector is at http://jimprice.com/jim-soft.shtml#eject | |
108 #and is not necessary for building the program | |
109 cf: lj.nds | |
110 cp lj.nds /h/ | |
111 ejector H: | |
112 | |
113 # PC side rules | |
114 | |
115 tools/fontconv.exe: tools/fontconv.o | |
116 gcc -Wall -s $^ -lalleg -o $@ | |
117 | |
118 tools/mktables.exe: tools/mktables.o | |
119 gcc -Wall -s $^ -o $@ | |
120 | |
121 tools/%.o: tools/%.c | |
122 gcc -Wall -O2 -std=gnu99 -c $< -o $@ | |
123 | |
124 $(objdir)/vwfont.bin: tools/fontconv.exe $(srcdir)/font.bmp | |
125 $^ $@ | |
126 | |
127 $(objdir)/lookup_tables7.s: tools/mktables.exe | |
128 $< | |
129 | |
130 # Cleanup rules | |
131 | |
132 clean: | |
133 -rm $(objdir)/*.s | |
134 -rm $(objdir)/*.o | |
135 -rm $(objdir)/*.P | |
136 |