File: Makefile.win_cross

package info (click to toggle)
vor 0.5.5-2
  • links: PTS, VCS
  • area: contrib
  • in suites: squeeze, wheezy
  • size: 936 kB
  • ctags: 389
  • sloc: ansic: 2,176; sh: 345; makefile: 109
file content (109 lines) | stat: -rw-r--r-- 2,974 bytes parent folder | download | duplicates (4)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#   Variations on Rockdodger
#   Copyright (C) 2004  Joshua Grams <josh@qualdan.com>

#   This program 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


# This makefile is for cross-compiling to a windows binary from a linux host
#
# It's ugly, in that it's just a copy of Makefile with the ldflags and cflags
# hardcoded and the install actions removed. 
#
# With this cross-compiler (mingw package in ubuntu) the order of -l gcc
# options matters, so the $(ldflags) was moved to the end of the link script


CC=i586-mingw32msvc-gcc
LD=i586-mingw32msvc-ld
AR=i586-mingw32msvc-ar
RC=i586-mingw32msvc-windres



# hard coded, must go at the end of the commandline for linking
ldflags = -L/usr/i586-mingw32msvc/lib -lmingw32 -lSDL_image -lpng -lz -lSDL_mixer -lSDLmain -lSDL -lwinmm -lgdi32 -mwindows -lm
cflags = -Wall -O3 -I/usr/i586-mingw32msvc/include -I/usr/i586-mingw32msvc/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main



my_objects := args.o dust.o file.o mt.o rocks.o score.o sprite.o sound.o autopilot.o
my_objects += main.o
libs := font.o
objects := $(libs) $(my_objects)

rocks := 00 01 02 03 04 05 06 07 08 09
rocks += 10 11 12 13 14 15 16 17 18 19
rocks += 20 21 22 23 24 25 26 27 28 29
rocks += 30 31 32 33 34 35 36 37 38 39
rocks += 40 41 42 43 44 45 46 47 48 49
rocks := $(rocks:%=data/rock%.png)
graphics := data/ship.png data/icon.png data/life.png data/font.png $(rocks)


.PHONY: all clean maintainer-clean
.PHONY: program program-clean
.PHONY: data data-clean

all: program data

data: $(graphics)

program: vor.exe

%.o: %.c
	@echo compiling $@ from $<
	@$(CC) $(cflags) -c -o $@ $<

$(my_objects): vorconfig.h

font.o: font.h

args.o: args.h

dust.o: globals.h dust.h float.h mt.h

file.o: file.h common.h

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

mt.o: mt.h

rocks.o: rocks.h common.h file.h globals.h mt.h sprite.h

score.o: score.h common.h file.h

sound.o: sound.h args.h common.h

sprite.o: sprite.h common.h

vor.exe: $(objects)
	@echo linking $@ from $^
	@$(CC) $^ -o $@ $(ldflags)

include gfx.mk

tags: *.c *.h
	exuberant-ctags *.c *.h /usr/include/SDL/*

clean: program-clean
	rm -f tags

maintainer-clean: program-clean data-clean

program-clean:
	rm -f *.o vor.exe

data-clean:
	rm -f $(graphics) font_guts font_guts.pov