-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
72 lines (53 loc) · 2 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Makefile for Allegro version of LOCKJAW
#
# Copr. 2006-2007 Damian Yerrick
#
# This work is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
EXE := lj.exe
CFLAGS := -Wall -O2 -std=gnu99 -DWITH_REPLAY=1
CC := gcc
LD := gcc
LDFLAGS := -Wall -s -mwindows
srcdir := src
objdir := obj/win32
MUSICOBJS := $(objdir)/ljvorbis.o
MUSICLIBS := -laldmb -ldumb -lvorbisfile -lvorbis -logg
LDLIBS := -ljpgal -lalleg
DEPOBJS := $(objdir)/ljpc.o $(objdir)/lj.o $(objdir)/ljplay.o $(objdir)/pcjoy.o $(objdir)/gimmicks.o $(objdir)/wktables.o $(objdir)/options.o $(objdir)/debrief.o $(objdir)/macro.o $(objdir)/ljreplay.o $(objdir)/ljmusic.o $(MUSICOBJS)
OTHEROBJS := $(objdir)/winicon.o
.PHONY: clean lj.gba lj.nds
# Objects
$(EXE): $(DEPOBJS) $(OTHEROBJS)
$(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LDLIBS) -o $@
all: $(EXE) lj.gba lj.nds
lj.gba:
make -f gbamakefile $@
lj.nds:
make -f dsmakefile $@
# Compilation rules
$(objdir)/%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) -MMD -c -o $@ $<
@cp $(objdir)/$*.d $(objdir)/$*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \
rm -f $(objdir)/$*.d
$(objdir)/%.o: src/%.rc docs/favicon.ico
windres -i $< -o $@
# Header dependencies
-include $(DEPOBJS:%.o=%.P)
# Cleanup rules
clean:
-rm $(objdir)/*.o
-rm $(objdir)/*.P