diff makefile @ 0:c84446dfb3f5

initial add
author paulo@localhost
date Fri, 13 Mar 2009 00:39:12 -0700
parents
children 38c62fded078
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/makefile	Fri Mar 13 00:39:12 2009 -0700
     1.3 @@ -0,0 +1,108 @@
     1.4 +# Makefile for Allegro version of LOCKJAW
     1.5 +# under Windows and Linux
     1.6 +#
     1.7 +# Copr. 2006-2007 Damian Yerrick
     1.8 +# 
     1.9 +# This work is free software; you can redistribute it and/or modify
    1.10 +# it under the terms of the GNU General Public License as published by
    1.11 +# the Free Software Foundation; either version 2 of the License, or
    1.12 +# (at your option) any later version.
    1.13 +# 
    1.14 +# This program is distributed in the hope that it will be useful,
    1.15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.17 +# GNU General Public License for more details.
    1.18 +# 
    1.19 +# You should have received a copy of the GNU General Public License
    1.20 +# along with this program; if not, write to the Free Software
    1.21 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.22 +
    1.23 +
    1.24 +EXE := lj.exe
    1.25 +CFLAGS := -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -DHAS_FPU
    1.26 +CC := gcc
    1.27 +LD := gcc
    1.28 +LDFLAGS := -Wall -s -mwindows
    1.29 +srcdir := src
    1.30 +objdir := obj/win32
    1.31 +
    1.32 +# Set this to the drive letter of your CF or SD card adapter
    1.33 +# so that 'make cf' works
    1.34 +# for info about Ejector by Jim Price, see the GBA makefile
    1.35 +CFDRIVE := h
    1.36 +
    1.37 +MUSICOBJS := $(objdir)/ljvorbis.o 
    1.38 +MUSICLIBS := -laldmb -ldumb -lvorbisfile -lvorbis -logg
    1.39 +
    1.40 +LDLIBS := -lshfolder -ljpgal -lalleg
    1.41 +LINUXLDLIBS := -ljpgal `allegro-config --libs`
    1.42 +DEPOBJS := $(objdir)/ljpc.o $(objdir)/lj.o $(objdir)/ljplay.o \
    1.43 +$(objdir)/pcjoy.o $(objdir)/gimmicks.o $(objdir)/random.o \
    1.44 +$(objdir)/wktables.o $(objdir)/speed.o $(objdir)/options.o \
    1.45 +$(objdir)/debrief.o $(objdir)/macro.o $(objdir)/ljreplay.o \
    1.46 +$(objdir)/ljmusic.o $(objdir)/old_pc_options.o $(objdir)/pcsound.o \
    1.47 +$(objdir)/pcdebrief.o $(objdir)/ljlocale.o $(objdir)/scenario.o \
    1.48 +$(objdir)/ljpath.o \
    1.49 +$(MUSICOBJS)
    1.50 +
    1.51 +OTHEROBJS := $(objdir)/winicon.o
    1.52 +
    1.53 +.PHONY: pc clean lj.gba lj.nds cf all run
    1.54 +
    1.55 +# Scripts to coordinate building the PC, GBA, and DS versions
    1.56 +
    1.57 +pc: $(EXE)
    1.58 +
    1.59 +run: $(EXE)
    1.60 +	./lj
    1.61 +
    1.62 +all: $(EXE) lj.gba lj.nds
    1.63 +
    1.64 +cf: /$(CFDRIVE)/gba/lj.gba /$(CFDRIVE)/lj.nds
    1.65 +	#ejector from http://www.jimprice.com/jim-soft.shtml#eject
    1.66 +	ejector $(CFDRIVE):
    1.67 +
    1.68 +/$(CFDRIVE)/gba/lj.gba: lj.gba
    1.69 +	cp $< $@
    1.70 +
    1.71 +/$(CFDRIVE)/lj.nds: lj.nds
    1.72 +	cp $< $@
    1.73 +
    1.74 +lj.gba:
    1.75 +	+make -f gbamakefile $@
    1.76 +
    1.77 +lj.nds:
    1.78 +	+make -f dsmakefile $@
    1.79 +
    1.80 +# Content of executable
    1.81 +
    1.82 +$(EXE): $(DEPOBJS) $(OTHEROBJS)
    1.83 +	$(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LDLIBS) -o $@
    1.84 +
    1.85 +# kesiev's makefile for GNU/Linux
    1.86 +
    1.87 +linux: $(DEPOBJS)
    1.88 +	$(LD) $(LDFLAGS) $^ $(MUSICLIBS) $(LINUXLDLIBS) -o lj
    1.89 +
    1.90 +# Compilation rules
    1.91 +
    1.92 +$(objdir)/%.o: $(srcdir)/%.c
    1.93 +	$(CC) $(CFLAGS) -MMD -c -o $@ $<
    1.94 +	@cp $(objdir)/$*.d $(objdir)/$*.P; \
    1.95 +	sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
    1.96 +	-e '/^$$/ d' -e 's/$$/ :/' < $(objdir)/$*.d >> $(objdir)/$*.P; \
    1.97 +	rm -f $(objdir)/$*.d
    1.98 +
    1.99 +$(objdir)/%.o: src/%.rc docs/favicon.ico
   1.100 +	windres -i $< -o $@
   1.101 +
   1.102 +# Header dependencies
   1.103 +
   1.104 +-include $(DEPOBJS:%.o=%.P)
   1.105 +
   1.106 +
   1.107 +# Cleanup rules
   1.108 +
   1.109 +clean:
   1.110 +	-rm $(objdir)/*.o
   1.111 +	-rm $(objdir)/*.P