File: Makefile

package info (click to toggle)
bloboats 1.0.2+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,868 kB
  • ctags: 1,099
  • sloc: cpp: 8,820; makefile: 117
file content (195 lines) | stat: -rw-r--r-- 5,786 bytes parent folder | download | duplicates (3)
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Released under GNU GPL version 2 except for a few datafiles.

### Installation options:
# These are the directories for `make install'
# NOTICE: Use absolute paths! ~ means $HOME, but ONLY for PRIVATEDIR.

### Installation directory (Installation prefix)
# If you don't have root privileges, set this to /home/tentacleman/bloboats/
# for example, otherwise /. Don't use ~ or other environment variables!
PREFIX ?= /

### Destination directory (Packager only)
DESTDIR ?=

### Or if you don't want to run make install at all, uncomments the next line
# and comment the line below. Compile and run with './bin/bloboats'
#DATADIR = data

DATADIR ?= $(PREFIX)/usr/games/bloboats/data

### If you do make install, you may perhaps want to set these

BINARYDIR ?= $(PREFIX)/usr/bin
CONFIGDIR ?= $(PREFIX)/etc

PRIVATEDIR = ~/.bloboats



### To compile, this program requires:
# SDL, SDL_image, SDL_mixer to compile. Libvorbis for music support.
# OpenGL support.

# since the sound files were removed from the tarball (see: README.Debian), we
# turn off the sound support

SOUND = 0
MUSIC = 1
DEBUG = 0

# Select target system
# Possible targets: DEFAULT (Linux and most of others too)
#                   FREEBSD
#                   NETBSD (use gmake)
#                   MACOSX (not sure if replay and ghost work)
#                   CROSS (for cross-compiling to win32)


#This should probably be DEFAULT
TARGET ?= DEFAULT


### Only some random settings below


# For compiling with an icon, set these

ICON = src/icon.o
ICON_CMD = i586-mingw32msvc-windres -i src/icon.rc -o $(ICON)


### C++ compiler to be used
CXX_DEFAULT = g++
CXX_FREEBSD = g++
CXX_NETBSD = g++
CXX_MACOSX = g++
CXX_CROSS = i586-mingw32msvc-g++

CXX = $(CXX_$(TARGET))


### SDL-Config in your system
SDLCONFIG_DEFAULT = sdl-config
SDLCONFIG_FREEBSD = sdl11-config
SDLCONFIG_NETBSD = sdl-config
SDLCONFIG_MACOSX = sdl-config
SDLCONFIG_CROSS = i586-mingw32msvc-sdl-config

SDLCONFIG = $(SDLCONFIG_$(TARGET))

### Libs
# no sound enable => no SDL_Mixer
LIBS_DEFAULT = `$(SDLCONFIG) --libs` -lSDL_image -lGL -lGLU
LIBS_FREEBSD = `$(SDLCONFIG) --libs` -lSDL_image -lSDL_mixer -L/usr/X11R6/lib -lGL -lGLU
LIBS_NETBSD = `$(SDLCONFIG) --libs` -lSDL_image -lSDL_mixer -lGL -lGLU -L/usr/pkg/lib
LIBS_MACOSX = `$(SDLCONFIG) --libs` -lSDL_image -lSDL_mixer -framework OpenGL
LIBS_CROSS = `$(SDLCONFIG) --libs` -lSDL_image -lSDL_mixer -lopengl32 -lglu32

LIBS = $(LIBS_$(TARGET))

### Binary path
BINARY_DEFAULT = bloboats
BINARY_FREEBSD = bloboats
BINARY_NETBSD = bloboats
BINARY_MACOSX = bloboats
BINARY_CROSS = bloboats.exe

BINARY = $(BINARY_$(TARGET))

### CXX-Flags
CXXFLAGS_DEFAULT = -g `$(SDLCONFIG) --cflags` -o bin/$(BINARY) -O2
CXXFLAGS_FREEBSD = -g `$(SDLCONFIG) --cflags` -I/usr/X11R6/include -o bin/$(BINARY) -O2
CXXFLAGS_NETBSD = -g `$(SDLCONFIG) --cflags` -O2 -I/usr/pkg/include
CXXFLAGS_MACOSX = -g `$(SDLCONFIG) --cflags` -o bin/$(BINARY) -O2
CXXFLAGS_CROSS = -g `$(SDLCONFIG) --cflags` -o bin/$(BINARY) -O2

CXXFLAGS = $(CXXFLAGS_$(TARGET))

### Stripping command
STRIP_DEFAULT = strip
STRIP_FREEBSD = strip
STRIP_NETBSD = strip
STRIP_MACOSX = strip
STRIP_CROSS = i586-mingw32msvc-strip

STRIP = $(STRIP_$(TARGET))


##########
# -fomit-frame-pointer -ffast-math


OBJ=src/main.o src/vec.o src/particle.o src/keyboard.o src/window.o src/mouse.o src/graphics.o src/wall.o src/spring.o \
src/model.o src/font.o src/compat.o src/level.o src/model_tex.o src/game.o src/menu.o \
src/menutext.o src/config.o src/player.o src/models/paatti.o src/models/canvas.o \
src/sound.o src/media.o src/path.o src/text.o src/models/hirvio.o src/models/invader.o \
src/water.o src/models/broken.o src/models/boulder.o src/element.o src/models/tux.o \
src/connection.o src/condition.o src/handler.o src/texfile.o

BINARY_DEFAULT_ = blobinv
BINARY_FREEBSD_ = blobinv
BINARY_NETBSD_ = blobinv
BINARY_MACOSX_ = blobinv
BINARY_CROSS_ = blobinv.exe
BINARY_ = $(BINARY_$(TARGET)_)
CXXFLAGS_DEFAULT_ = -g `$(SDLCONFIG) --cflags` -o bin/$(BINARY_) -O2
CXXFLAGS_FREEBSD_ = -g `$(SDLCONFIG) --cflags` -I/usr/X11R6/include -o bin/$(BINARY_) -O2
CXXFLAGS_NETBSD = -g `$(SDLCONFIG) --cflags` -O2 -I/usr/pkg/include
CXXFLAGS_MACOSX_ = -g `$(SDLCONFIG) --cflags` -o bin/$(BINARY_) -O2
CXXFLAGS_CROSS_ = -g `$(SDLCONFIG) --cflags` -o bin/$(BINARY_) -O2
CXXFLAGS_ = $(CXXFLAGS_$(TARGET)_)

all: config-stamp build-stamp

#main: $(OBJ)
build-stamp: build
build: config-stamp $(OBJ)
	mkdir -p bin
	$(CXX) $(LDFLAGS) $(OBJ) $(LIBS) $(CXXFLAGS)
	touch build-stamp
	#$(STRIP) bin/$(BINARY)

icon:
	$(ICON_CMD)
	$(CXX) -o bin/$(BINARY) $(OBJ) $(ICON) $(LIBS)
	#$(STRIP) bin/$(BINARY)

config-stamp: config
config:
	echo "datadir $(DATADIR)" >bloboats.dirs
	echo "privatedir $(PRIVATEDIR)" >>bloboats.dirs
	chmod 644 bloboats.dirs
	echo "#define DEFAULT_CONFIGFILE \"$(CONFIGDIR)/bloboats.dirs\"" >src/compiling_settings.h
	echo "#define SOUND $(SOUND)" >> src/compiling_settings.h
	echo "#define MUSIC $(MUSIC)" >> src/compiling_settings.h
	echo "#define DEBUG $(DEBUG)" >> src/compiling_settings.h
	touch config-stamp

install: build-stamp
	mkdir -p $(DESTDIR)/$(BINARYDIR)/
	mkdir -p $(DESTDIR)/$(CONFIGDIR)/
	cp bloboats.dirs $(DESTDIR)/$(CONFIGDIR)/
	mkdir -p $(DESTDIR)/$(DATADIR)/
	cp -R data/* $(DESTDIR)/$(DATADIR)/
	cp bin/$(BINARY) $(DESTDIR)/$(BINARYDIR)/
	chmod 755 `find $(DESTDIR)/$(DATADIR) -type d`

uninstall:
	rm -f $(CONFIGDIR)/bloboats.dirs
	rm -rf $(DATADIR)/*
	rm -f $(BINARYDIR)/bloboats
	rmdir -p --ignore-fail-on-non-empty $(DATADIR)
	rmdir -p --ignore-fail-on-non-empty $(CONFIGDIR)
	rmdir -p --ignore-fail-on-non-empty $(BINARYDIR)

gho: src/viewport.o
	$(CXX) src/viewport.o $(LIBS) $(CXXFLAGS_)
	#$(STRIP) bin/$(BINARY_)

clean:
	rm -f bloboats.dirs
	rm -f src/*.o
	rm -f src/models/*.o
	rm -f bin/$(BINARY)
	rm -f *-stamp