git repos / blockattack-game

blame: source/code/Makefile

normal view · raw

6cd0a332 sago007 2008-11-13 20:02 1
GAMEDIR=../../Game/
78d03b38 sago007 2008-11-13 19:56 2
2f30c381 sago007 2008-09-14 13:08 3
BINARY=$(GAMEDIR)blockattack
78d03b38 sago007 2008-11-13 19:56 4
8d488d32 sago007 2011-04-17 13:02 5
ifndef CC
6cd0a332 sago007 2008-11-13 20:02 6
CC=gcc
8d488d32 sago007 2011-04-17 13:02 7
endif
78d03b38 sago007 2008-11-13 19:56 8
70f47bf7 sago007 2014-09-10 17:25 9
ifdef CROSS
70f47bf7 sago007 2014-09-10 17:25 10
CXX=$(CROSS)g++
70f47bf7 sago007 2014-09-10 17:25 11
endif
78d03b38 sago007 2008-11-13 19:56 12
70f47bf7 sago007 2014-09-10 17:25 13
BASE_CFLAGS=-c $(shell $(CROSS)sdl-config --cflags)
78d03b38 sago007 2008-11-13 19:56 14
8d488d32 sago007 2011-04-17 13:02 15
ifndef BUILDDIR
8d488d32 sago007 2011-04-17 13:02 16
BUILDDIR=build
8d488d32 sago007 2011-04-17 13:02 17
endif
6cd0a332 sago007 2008-11-13 20:02 18
70f47bf7 sago007 2014-09-10 17:25 19
BASE_LIBS=$(shell $(CROSS)sdl-config --libs) $(shell $(CROSS)pkg-config SDL_image SDL_mixer SDL_ttf --libs) 
2f30c381 sago007 2008-09-14 13:08 20
e3e0644e sago007 2008-09-25 14:00 21
#For developement only 
2f30c381 sago007 2008-09-14 13:08 22
ifndef DEBUG
56241205 sago007 2012-08-05 11:15 23
DEBUG=0
2f30c381 sago007 2008-09-14 13:08 24
endif
2f30c381 sago007 2008-09-14 13:08 25
2f30c381 sago007 2008-09-14 13:08 26
ifndef NETWORK
e1290bdf sago007 2010-10-25 19:56 27
NETWORK=1
2f30c381 sago007 2008-09-14 13:08 28
endif
2f30c381 sago007 2008-09-14 13:08 29
e3e0644e sago007 2008-09-25 14:00 30
#Compile with debug information or optimized.
2f30c381 sago007 2008-09-14 13:08 31
ifeq ($(DEBUG),1)
80b830cd sago007 2012-08-19 17:51 32
BASE_CFLAGS += -g -DDEBUG=1 -Wall
a039f5c4 sago007 2008-09-19 23:12 33
else
80b830cd sago007 2012-08-19 17:51 34
BASE_CFLAGS += -O3 
2f30c381 sago007 2008-09-14 13:08 35
endif
2f30c381 sago007 2008-09-14 13:08 36
2f30c381 sago007 2008-09-14 13:08 37
ifeq ($(NETWORK),1)
2f30c381 sago007 2008-09-14 13:08 38
BASE_CFLAGS += -DNETWORK=1
2f30c381 sago007 2008-09-14 13:08 39
BASE_LIBS += -lenet
2f30c381 sago007 2008-09-14 13:08 40
else
2f30c381 sago007 2008-09-14 13:08 41
BASE_CFLAGS += -DNETWORK=0
2f30c381 sago007 2008-09-14 13:08 42
endif
2f30c381 sago007 2008-09-14 13:08 43
a039f5c4 sago007 2008-09-19 23:12 44
BASE_LIBS += -lphysfs
a039f5c4 sago007 2008-09-19 23:12 45
32c6e29e sago007 2014-01-22 18:55 46
OFILES=main.o highscore.o ReadKeyboard.o joypad.o listFiles.o replay.o common.o stats.o CppSdlException.o CppSdlImageHolder.o Libs/NFont.o MenuSystem.o menudef.o
f62f552d sago007 2008-08-29 14:34 47
fb6646e4 sago007 2014-09-11 16:30 48
ifeq ($(CROSS),i686-pc-mingw32-)
fb6646e4 sago007 2014-09-11 16:30 49
OFILES += winicon.res
e90165e3 sago007 2014-09-15 16:26 50
BINARY := $(BINARY).exe
fb6646e4 sago007 2014-09-11 16:30 51
endif
fb6646e4 sago007 2014-09-11 16:30 52
32c6e29e sago007 2014-01-22 18:55 53
$(BINARY): 	$(OFILES)
70f47bf7 sago007 2014-09-10 17:25 54
	$(CXX) -O -o $(BINARY) $(OFILES) $(BASE_LIBS)
32c6e29e sago007 2014-01-22 18:55 55
#-lphysfs
78d03b38 sago007 2008-11-13 19:56 56
fb6646e4 sago007 2014-09-11 16:30 57
winicon.res:	winicon.rc
fb6646e4 sago007 2014-09-11 16:30 58
	$(CROSS)windres winicon.rc -O coff -o winicon.res
fb6646e4 sago007 2014-09-11 16:30 59
32c6e29e sago007 2014-01-22 18:55 60
%.o : %.cpp
70f47bf7 sago007 2014-09-10 17:25 61
	$(CXX) -MD $(BASE_CFLAGS) -c -o $@ $<
32c6e29e sago007 2014-01-22 18:55 62
	@cp $*.d $*.P; \
32c6e29e sago007 2014-01-22 18:55 63
             sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
32c6e29e sago007 2014-01-22 18:55 64
                 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
32c6e29e sago007 2014-01-22 18:55 65
             rm -f $*.d
605138b3 sago007 2012-04-14 15:12 66
32c6e29e sago007 2014-01-22 18:55 67
-include *.P
605138b3 sago007 2012-04-14 15:12 68
78d03b38 sago007 2008-11-13 19:56 69
2f30c381 sago007 2008-09-14 13:08 70
run: $(BINARY)
32c6e29e sago007 2014-01-22 18:55 71
	cd $(GAMEDIR) && ./blockattack
f62f552d sago007 2008-08-29 14:34 72
f62f552d sago007 2008-08-29 14:34 73
clean:
32c6e29e sago007 2014-01-22 18:55 74
	rm *.o *.P
1970-01-01 00:00 75