JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Improved keybindings: support numbad stearing instead of dvorak, support 'pause'...
[vor.git] / Makefile.win_cross
1 #   Variations on Rockdodger
2 #   Copyright (C) 2004  Joshua Grams <josh@qualdan.com>
3
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.
8
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.
13
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
17
18
19 # This makefile is for cross-compiling to a windows binary from a linux host
20 #
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. 
23 #
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
26
27
28 CC=i586-mingw32msvc-gcc
29 LD=i586-mingw32msvc-ld
30 AR=i586-mingw32msvc-ar
31 RC=i586-mingw32msvc-windres
32
33
34
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
38
39
40
41 my_objects := args.o dust.o file.o mt.o rocks.o score.o sprite.o sound.o autopilot.o
42 my_objects += main.o
43 libs := font.o
44 objects := $(libs) $(my_objects)
45
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)
53
54
55 .PHONY: all clean maintainer-clean
56 .PHONY: program program-clean
57 .PHONY: data data-clean
58
59 all: program data
60
61 data: $(graphics)
62
63 program: vor.exe
64
65 %.o: %.c
66         @echo compiling $@ from $<
67         @$(CC) $(cflags) -c -o $@ $<
68
69 $(my_objects): config.h
70
71 font.o: font.h
72
73 args.o: args.h
74
75 dust.o: globals.h dust.h float.h mt.h
76
77 file.o: file.h common.h
78
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
80
81 mt.o: mt.h
82
83 rocks.o: rocks.h common.h file.h globals.h mt.h sprite.h
84
85 score.o: score.h common.h file.h
86
87 sound.o: sound.h args.h common.h
88
89 sprite.o: sprite.h common.h
90
91 vor.exe: $(objects)
92         @echo linking $@ from $^
93         @$(CC) $^ -o $@ $(ldflags)
94
95 include gfx.mk
96
97 tags: *.c *.h
98         exuberant-ctags *.c *.h /usr/include/SDL/*
99
100 clean: program-clean
101         rm -f tags
102
103 maintainer-clean: program-clean data-clean
104
105 program-clean:
106         rm -f *.o vor.exe
107
108 data-clean:
109         rm -f $(graphics) font_guts font_guts.pov