rev |
line source |
paulo@0
|
1 # Makefile for Allegro version of LOCKJAW
|
paulo@0
|
2 # under Windows and Linux
|
paulo@0
|
3 #
|
paulo@0
|
4 # Copr. 2006-2007 Damian Yerrick
|
paulo@0
|
5 #
|
paulo@0
|
6 # This work is free software; you can redistribute it and/or modify
|
paulo@0
|
7 # it under the terms of the GNU General Public License as published by
|
paulo@0
|
8 # the Free Software Foundation; either version 2 of the License, or
|
paulo@0
|
9 # (at your option) any later version.
|
paulo@0
|
10 #
|
paulo@0
|
11 # This program is distributed in the hope that it will be useful,
|
paulo@0
|
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
paulo@0
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
paulo@0
|
14 # GNU General Public License for more details.
|
paulo@0
|
15 #
|
paulo@0
|
16 # You should have received a copy of the GNU General Public License
|
paulo@0
|
17 # along with this program; if not, write to the Free Software
|
paulo@0
|
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
paulo@0
|
19
|
paulo@0
|
20
|
paulo@0
|
21 EXE := lj.exe
|
paulo@0
|
22 CFLAGS := -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -DHAS_FPU
|
paulo@0
|
23 CC := gcc
|
paulo@0
|
24 LD := gcc
|
paulo@0
|
25 LDFLAGS := -Wall -s -mwindows
|
paulo@0
|
26 srcdir := src
|
paulo@0
|
27 objdir := obj/win32
|
paulo@0
|
28
|
paulo@0
|
29 # Set this to the drive letter of your CF or SD card adapter
|
paulo@0
|
30 # so that 'make cf' works
|
paulo@0
|
31 # for info about Ejector by Jim Price, see the GBA makefile
|
paulo@0
|
32 CFDRIVE := h
|
paulo@0
|
33
|
paulo@0
|
34 MUSICOBJS := $(objdir)/ljvorbis.o
|
paulo@0
|
35 MUSICLIBS := -laldmb -ldumb -lvorbisfile -lvorbis -logg
|
paulo@0
|
36
|
paulo@0
|
37 LDLIBS := -lshfolder -ljpgal -lalleg
|
paulo@0
|
38 LINUXLDLIBS := -ljpgal `allegro-config --libs`
|
paulo@0
|
39 DEPOBJS := $(objdir)/ljpc.o $(objdir)/lj.o $(objdir)/ljplay.o \
|
paulo@0
|
40 $(objdir)/pcjoy.o $(objdir)/gimmicks.o $(objdir)/random.o \
|
paulo@0
|
41 $(objdir)/wktables.o $(objdir)/speed.o $(objdir)/options.o \
|
paulo@0
|
42 $(objdir)/debrief.o $(objdir)/macro.o $(objdir)/ljreplay.o \
|
paulo@0
|
43 $(objdir)/ljmusic.o $(objdir)/old_pc_options.o $(objdir)/pcsound.o \
|
paulo@0
|
44 $(objdir)/pcdebrief.o $(objdir)/ljlocale.o $(objdir)/scenario.o \
|
paulo@0
|
45 $(objdir)/ljpath.o \
|
paulo@0
|
46 $(MUSICOBJS)
|
paulo@0
|
47
|
paulo@0
|
48 OTHEROBJS := $(objdir)/winicon.o
|
paulo@0
|
49
|
paulo@0
|
50 .PHONY: pc clean lj.gba lj.nds cf all run
|
paulo@0
|
51
|
paulo@0
|
52 # Scripts to coordinate building the PC, GBA, and DS versions
|
paulo@0
|
53
|
paulo@0
|
54 pc: $(EXE)
|
paulo@0
|
55
|
paulo@0
|
56 run: $(EXE)
|
paulo@0
|
57 ./lj
|
paulo@0
|
58
|
paulo@0
|
59 all: $(EXE) lj.gba lj.nds
|
paulo@0
|
60
|
paulo@0
|
61 cf: /$(CFDRIVE)/gba/lj.gba /$(CFDRIVE)/lj.nds
|
paulo@0
|
62 #ejector from http://www.jimprice.com/jim-soft.shtml#eject
|
paulo@0
|
63 ejector $(CFDRIVE):
|
paulo@0
|
64
|
paulo@0
|
65 /$(CFDRIVE)/gba/lj.gba: lj.gba
|
paulo@0
|
66 cp $< $@
|
paulo@0
|
67
|
paulo@0
|
68 /$(CFDRIVE)/lj.nds: lj.nds
|
paulo@0
|
69 cp $< $@
|
paulo@0
|
70
|
paulo@0
|
71 lj.gba:
|
paulo@0
|
72 +make -f gbamakefile $@
|
paulo@0
|
73
|
paulo@0
|
74 lj.nds:
|
paulo@0
|
75 +make -f dsmakefile $@
|
paulo@0
|
76
|
paulo@0
|
77 # Content of executable
|
paulo@0
|
78
|
paulo@0
|
79 $(EXE): $(DEPOBJS) $(OTHEROBJS)
|
paulo@0
|
80 $(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LDLIBS) -o $@
|
paulo@0
|
81
|
paulo@0
|
82 # kesiev's makefile for GNU/Linux
|
paulo@0
|
83
|
paulo@0
|
84 linux: $(DEPOBJS)
|
paulo@0
|
85 $(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LINUXLDLIBS) -o lj
|
paulo@0
|
86
|
paulo@0
|
87 # Compilation rules
|
paulo@0
|
88
|
paulo@0
|
89 $(objdir)/%.o: $(srcdir)/%.c
|
paulo@0
|
90 $(CC) $(CFLAGS) -MMD -c -o $@ $<
|
paulo@0
|
91 @cp $(objdir)/$*.d $(objdir)/$*.P; \
|
paulo@0
|
92 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
|
paulo@0
|
93 -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \
|
paulo@0
|
94 rm -f $(objdir)/$*.d
|
paulo@0
|
95
|
paulo@0
|
96 $(objdir)/%.o: src/%.rc docs/favicon.ico
|
paulo@0
|
97 windres -i $< -o $@
|
paulo@0
|
98
|
paulo@0
|
99 # Header dependencies
|
paulo@0
|
100
|
paulo@0
|
101 -include $(DEPOBJS:%.o=%.P)
|
paulo@0
|
102
|
paulo@0
|
103
|
paulo@0
|
104 # Cleanup rules
|
paulo@0
|
105
|
paulo@0
|
106 clean:
|
paulo@0
|
107 -rm $(objdir)/*.o
|
paulo@0
|
108 -rm $(objdir)/*.P
|