1 # Variations on Rockdodger
2 # Copyright (C) 2004 Joshua Grams <josh@qualdan.com>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # This makefile is for cross-compiling to a windows binary from a linux host
21 # It's ugly, in that it's just a copy of Makefile with the ldflags and cflags
22 # hardcoded and the install actions removed.
24 # With this cross-compiler (mingw package in ubuntu) the order of -l gcc
25 # options matters, so the $(ldflags) was moved to the end of the link script
28 CC=i586-mingw32msvc-gcc
29 LD=i586-mingw32msvc-ld
30 AR=i586-mingw32msvc-ar
31 RC=i586-mingw32msvc-windres
35 # hard coded, must go at the end of the commandline for linking
36 ldflags = -L/usr/i586-mingw32msvc/lib -lmingw32 -lSDL_image -lpng -lz -lSDL_mixer -lSDLmain -lSDL -lwinmm -lgdi32 -mwindows -lm
37 cflags = -Wall -O3 -I/usr/i586-mingw32msvc/include -I/usr/i586-mingw32msvc/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main
41 my_objects := args.o dust.o file.o mt.o rocks.o score.o sprite.o sound.o autopilot.o
44 objects := $(libs) $(my_objects)
46 rocks := 00 01 02 03 04 05 06 07 08 09
47 rocks += 10 11 12 13 14 15 16 17 18 19
48 rocks += 20 21 22 23 24 25 26 27 28 29
49 rocks += 30 31 32 33 34 35 36 37 38 39
50 rocks += 40 41 42 43 44 45 46 47 48 49
51 rocks := $(rocks:%=data/rock%.png)
52 graphics := data/ship.png data/icon.png data/life.png data/font.png $(rocks)
55 .PHONY: all clean maintainer-clean
56 .PHONY: program program-clean
57 .PHONY: data data-clean
66 @echo compiling $@ from $<
67 @$(CC) $(cflags) -c -o $@ $<
69 $(my_objects): config.h
75 dust.o: globals.h dust.h float.h mt.h
77 file.o: file.h common.h
79 main.o: args.h common.h dust.h file.h float.h globals.h mt.h rocks.h score.h sprite.h sound.h autopilot.h
83 rocks.o: rocks.h common.h file.h globals.h mt.h sprite.h
85 score.o: score.h common.h file.h
87 sound.o: sound.h args.h common.h
89 sprite.o: sprite.h common.h
92 @echo linking $@ from $^
93 @$(CC) $^ -o $@ $(ldflags)
98 exuberant-ctags *.c *.h /usr/include/SDL/*
103 maintainer-clean: program-clean data-clean
109 rm -f $(graphics) font_guts font_guts.pov