view makefile @ 0:c84446dfb3f5

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