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
605138b3 sago007 2012-04-14 15:12 9
#ifndef CPP
6cd0a332 sago007 2008-11-13 20:02 10
CPP=g++
605138b3 sago007 2012-04-14 15:12 11
#endif
78d03b38 sago007 2008-11-13 19:56 12
6cd0a332 sago007 2008-11-13 20:02 13
BASE_CFLAGS=-c $(shell 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
925b7e58 sago007 2011-04-25 16:35 19
BASE_LIBS=$(shell sdl-config --libs) -lSDL_image -lSDL_mixer -lSDL_ttf
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
32c6e29e sago007 2014-01-22 18:55 48
$(BINARY): 	$(OFILES)
32c6e29e sago007 2014-01-22 18:55 49
	$(CPP) -O -o $(BINARY) $(OFILES) $(BASE_LIBS)
32c6e29e sago007 2014-01-22 18:55 50
#-lphysfs
78d03b38 sago007 2008-11-13 19:56 51
32c6e29e sago007 2014-01-22 18:55 52
%.o : %.cpp
32c6e29e sago007 2014-01-22 18:55 53
	g++ -MD $(BASE_CFLAGS) -c -o $@ $<
32c6e29e sago007 2014-01-22 18:55 54
	@cp $*.d $*.P; \
32c6e29e sago007 2014-01-22 18:55 55
             sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
32c6e29e sago007 2014-01-22 18:55 56
                 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
32c6e29e sago007 2014-01-22 18:55 57
             rm -f $*.d
605138b3 sago007 2012-04-14 15:12 58
32c6e29e sago007 2014-01-22 18:55 59
-include *.P
605138b3 sago007 2012-04-14 15:12 60
78d03b38 sago007 2008-11-13 19:56 61
2f30c381 sago007 2008-09-14 13:08 62
run: $(BINARY)
32c6e29e sago007 2014-01-22 18:55 63
	cd $(GAMEDIR) && ./blockattack
f62f552d sago007 2008-08-29 14:34 64
f62f552d sago007 2008-08-29 14:34 65
clean:
32c6e29e sago007 2014-01-22 18:55 66
	rm *.o *.P
1970-01-01 00:00 67