annotate makefile @ 2:80a2761bd3a4

change DS keys (add alt. rotate)
author paulo@localhost
date Mon, 23 Mar 2009 01:19:12 -0700
parents c84446dfb3f5
children
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@1 35 #MUSICLIBS := -laldmb -ldumb -lvorbisfile -lvorbis -logg
paulo@1 36 MUSICLIBS := -lvorbisfile -lvorbis -logg
paulo@0 37
paulo@0 38 LDLIBS := -lshfolder -ljpgal -lalleg
paulo@0 39 LINUXLDLIBS := -ljpgal `allegro-config --libs`
paulo@0 40 DEPOBJS := $(objdir)/ljpc.o $(objdir)/lj.o $(objdir)/ljplay.o \
paulo@0 41 $(objdir)/pcjoy.o $(objdir)/gimmicks.o $(objdir)/random.o \
paulo@0 42 $(objdir)/wktables.o $(objdir)/speed.o $(objdir)/options.o \
paulo@0 43 $(objdir)/debrief.o $(objdir)/macro.o $(objdir)/ljreplay.o \
paulo@0 44 $(objdir)/ljmusic.o $(objdir)/old_pc_options.o $(objdir)/pcsound.o \
paulo@0 45 $(objdir)/pcdebrief.o $(objdir)/ljlocale.o $(objdir)/scenario.o \
paulo@0 46 $(objdir)/ljpath.o \
paulo@0 47 $(MUSICOBJS)
paulo@0 48
paulo@0 49 OTHEROBJS := $(objdir)/winicon.o
paulo@0 50
paulo@0 51 .PHONY: pc clean lj.gba lj.nds cf all run
paulo@0 52
paulo@0 53 # Scripts to coordinate building the PC, GBA, and DS versions
paulo@0 54
paulo@0 55 pc: $(EXE)
paulo@0 56
paulo@0 57 run: $(EXE)
paulo@0 58 ./lj
paulo@0 59
paulo@0 60 all: $(EXE) lj.gba lj.nds
paulo@0 61
paulo@0 62 cf: /$(CFDRIVE)/gba/lj.gba /$(CFDRIVE)/lj.nds
paulo@0 63 #ejector from http://www.jimprice.com/jim-soft.shtml#eject
paulo@0 64 ejector $(CFDRIVE):
paulo@0 65
paulo@0 66 /$(CFDRIVE)/gba/lj.gba: lj.gba
paulo@0 67 cp $< $@
paulo@0 68
paulo@0 69 /$(CFDRIVE)/lj.nds: lj.nds
paulo@0 70 cp $< $@
paulo@0 71
paulo@0 72 lj.gba:
paulo@0 73 +make -f gbamakefile $@
paulo@0 74
paulo@0 75 lj.nds:
paulo@0 76 +make -f dsmakefile $@
paulo@0 77
paulo@0 78 # Content of executable
paulo@0 79
paulo@0 80 $(EXE): $(DEPOBJS) $(OTHEROBJS)
paulo@0 81 $(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LDLIBS) -o $@
paulo@0 82
paulo@0 83 # kesiev's makefile for GNU/Linux
paulo@0 84
paulo@0 85 linux: $(DEPOBJS)
paulo@0 86 $(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LINUXLDLIBS) -o lj
paulo@0 87
paulo@0 88 # Compilation rules
paulo@0 89
paulo@0 90 $(objdir)/%.o: $(srcdir)/%.c
paulo@0 91 $(CC) $(CFLAGS) -MMD -c -o $@ $<
paulo@0 92 @cp $(objdir)/$*.d $(objdir)/$*.P; \
paulo@0 93 sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
paulo@0 94 -e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \
paulo@0 95 rm -f $(objdir)/$*.d
paulo@0 96
paulo@0 97 $(objdir)/%.o: src/%.rc docs/favicon.ico
paulo@0 98 windres -i $< -o $@
paulo@0 99
paulo@0 100 # Header dependencies
paulo@0 101
paulo@0 102 -include $(DEPOBJS:%.o=%.P)
paulo@0 103
paulo@0 104
paulo@0 105 # Cleanup rules
paulo@0 106
paulo@0 107 clean:
paulo@0 108 -rm $(objdir)/*.o
paulo@0 109 -rm $(objdir)/*.P