[go: up one dir, main page]

Menu

[r52]: / engine / makefile.mac  Maximize  Restore  History

Download this file

188 lines (142 with data), 4.6 kB

  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
#####################################
# #
# Makefile for IRE, MacOS version #
# #
#####################################
# Define all the targets first
all: library_bgui2 library_ithe ire ed chknpc crypter resize png2cel cel2png # mover
##
## Configurables:
##
# Where to put binary on 'make install'?
INSTALL_BIN = $/usr/games
# Where to put data on 'make install'?
INSTALL_DATA = $/usr/share/games/ire/data
# Where to put data on 'make install'?
INI_FILES = $/etc/ire
# Debugging and profiling
#PROF += -pg
DBG += -g
# Pick one of the following sound libraries:
# SOUND = fmod3 # Higher quality, but non-Free
# SOUND = fmod4 # Higher quality, but non-Free (experimental)
# SOUND = allegro # Lower quality, but fully-Free
# SOUND = sdl # Higher quality, fully-Free, needs SDL_mixer
SOUND = none
# Choose whether to use the X86 assembly optimisations
# ASM = asm # Use optional assembly code
# ASM = no_asm # no assembly code
ASM = no_asm
##
## Okay, do the stuff
##
# FMOD3 sound library. May need tweaking
ifeq ($(SOUND),fmod3)
SOUNDLIB_C = -DUSE_FMOD3
# Force IRE to load the FMOD library from current dir
SOUNDLIB_L = -lfmod-3.70 -L. -Xlinker -rpath .
endif
# FMOD4 sound library. May need tweaking
ifeq ($(SOUND),fmod4)
SOUNDLIB_C = -DUSE_FMOD4
# Force IRE to load the FMOD library from current dir
# SOUNDLIB_L = -lfmod-3.6 -L. -Xlinker -rpath .
SOUNDLIB_L = -lfmodex
endif
# ALLEGRO sound library with ALOGG.
ifeq ($(SOUND),allegro)
SOUNDLIB_C = -DUSE_ALOGG -DUSE_ALSOUND `alogg-config --cflags`
SOUNDLIB_L = `alogg-config --libs`
endif
# SDL sound library
ifeq ($(SOUND),sdl)
SOUNDLIB_C = -DUSE_SDLSOUND `sdl-config --cflags`
SOUNDLIB_L = `sdl-config --libs` -lSDL_mixer
endif
# no sound library
ifeq ($(SOUND),none)
SOUNDLIB_C = -DUSE_NOSOUND
SOUNDLIB_L =
endif
# Use the C or C++ compiler
CC = gcc-4.0
LD = gcc-4.0
CFLAGS = -O3 -m32 -Wall $(PROF) $(DBG)
CFLAGS += -I. -DPATH_FILES_DAT=\"/$(INSTALL_DATA)/\" -DPATH_FILES_CONF=\"/$(INI_FILES)/\" -DALLEGRO -DBGUI `allegro-config --cflags` $(SOUNDLIB_C) -Ijpeg/mac
#LDFLAGS = `allegro-config --static`
LDFLAGS = `allegro-config --libs` $(PROF) $(DBG)
Xopts = -Llibs/mac
Lib_files = -lithe -ljpeg_x86 -lpng_x86 -lbgui -lz -lstdc++
# -lX11 -lXext
ifeq ($(ASM),no_asm)
CFLAGS += -DNO_ASM
endif
# include the BGUI2 library
include deb/makefile.bgui2
# include the IT-HE support library
include deb/makefile.ithe
# Include the makefile core
include makefile.all
# Linux-dependent components
lin_obj += audio/fmod3.o audio/fmod4.o audio/allegro.o audio/sdl.o audio/nosound.o
ifneq ($(ASM),no_asm)
lin_obj += darken_a.o
endif
# Makefile rules
ire: $(ire_obj) $(lin_obj)
$(LD) $(Xopts) $(ire_obj) $(lin_obj) $(Lib_files) -o ../ire-engine $(LDFLAGS) $(SOUNDLIB_L)
-rm -f ire.o
ed: $(ed_obj) $(lin_obj)
$(LD) $(Xopts) $(ed_obj) $(lin_obj) $(Lib_files) -o ../ire-ed $(LDFLAGS) $(SOUNDLIB_L)
-rm -f editor.o
resedit: $(res_obj)
$(LD) $(Xopts) $(res_obj) $(Lib_files) -o res $(LDFLAGS)
-rm -f res.o
resize: $(resize_obj)
$(LD) $(Xopts) $(resize_obj) -lithe -ljpeg_x86 -o tools/resize_map $(LDFLAGS) -lstdc++
mover: $(move_obj)
$(LD) $(Xopts) $(move_obj) -lithe -ljpeg_x86 -o tools/mover $(LDFLAGS)
chknpc: $(chknpc_obj)
$(LD) $(chknpc_obj) -o tools/chknpc
crypter: $(crypter_obj)
$(LD) $(crypter_obj) -o tools/crypter
png2cel: $(png2cel_obj)
$(LD) $(Xopts) $(png2cel_obj) -lpng_x86 -lz -o tools/png2cel
cel2png: $(cel2png_obj)
$(LD) $(Xopts) $(cel2png_obj) -lpng_x86 -lz -o tools/cel2png
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
%.o: %.cc
$(CC) -c $(CFLAGS) $< -o $@
%.o: %.cpp
$(CC) -c $(CFLAGS) $< -o $@
%.o: %.S
$(CC) -c $(CFLAGS) $< -o $@
ifeq ($(ASM),asm)
%.o: %.asm
nasm -f elf $< -o $@
endif
clean:
-rm -f $(ire_obj) $(ed_obj) $(resize_obj) $(chknpc_obj)
-rm -f $(lin_obj) $(crypter_obj) $(move_obj)
-rm -f $(Object_ithe) $(Object_bgui2)
-rm -f ../ire-engine
-rm -f ../ire-ed
-rm -f tools/chknpc
-rm -f tools/crypter
-rm -f tools/resize_map
distclean:
-rm -f $(ire_obj) $(ed_obj) $(resize_obj) $(chknpc_obj)
-rm -f $(lin_obj) $(crypter_obj) $(move_obj)
-rm -f $(Object_ithe) $(Object_bgui2)
-rm -f ../ire-engine
-rm -f ../ire-ed
-rm -f bootlog.* game.cfg
-rm -f tools/*
-rm -f $(library_ithe)
-rm -f $(library_bgui2)
install:
install -d $(INSTALL_BIN) $(INSTALL_DATA) $(INI_FILES)
install ../ire $(INSTALL_BIN)
install ../ire-ed $(INSTALL_BIN)
install -m644 ../game.ini $(INI_FILES)/game.ini