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
6332acb6 sago007 2015-12-19 17:51 5
-include sago/Makefile.sago
6332acb6 sago007 2015-12-19 17:51 6
8d488d32 sago007 2011-04-17 13:02 7
ifndef CC
6cd0a332 sago007 2008-11-13 20:02 8
CC=gcc
8d488d32 sago007 2011-04-17 13:02 9
endif
78d03b38 sago007 2008-11-13 19:56 10
70f47bf7 sago007 2014-09-10 17:25 11
ifdef CROSS
70f47bf7 sago007 2014-09-10 17:25 12
CXX=$(CROSS)g++
70f47bf7 sago007 2014-09-10 17:25 13
endif
78d03b38 sago007 2008-11-13 19:56 14
078900fe sago007 2015-12-05 15:31 15
BASE_CFLAGS=-c $(shell $(CROSS)sdl2-config --cflags) -std=c++11
78d03b38 sago007 2008-11-13 19:56 16
8d488d32 sago007 2011-04-17 13:02 17
ifndef BUILDDIR
8d488d32 sago007 2011-04-17 13:02 18
BUILDDIR=build
8d488d32 sago007 2011-04-17 13:02 19
endif
6cd0a332 sago007 2008-11-13 20:02 20
7d1936bd sago007 2015-12-23 16:06 21
BASE_LIBS=$(shell $(CROSS)sdl2-config --libs) -lSDL2_ttf $(shell $(CROSS)pkg-config SDL2_image SDL2_mixer --libs) $(SAGO_BASE_LIBS)
2f30c381 sago007 2008-09-14 13:08 22
e3e0644e sago007 2008-09-25 14:00 23
#For developement only 
2f30c381 sago007 2008-09-14 13:08 24
ifndef DEBUG
7d1936bd sago007 2015-12-23 16:06 25
DEBUG=1
2f30c381 sago007 2008-09-14 13:08 26
endif
2f30c381 sago007 2008-09-14 13:08 27
2f30c381 sago007 2008-09-14 13:08 28
ifndef NETWORK
ca486238 sago007 2015-08-23 15:12 29
NETWORK=0
2f30c381 sago007 2008-09-14 13:08 30
endif
2f30c381 sago007 2008-09-14 13:08 31
e3e0644e sago007 2008-09-25 14:00 32
#Compile with debug information or optimized.
2f30c381 sago007 2008-09-14 13:08 33
ifeq ($(DEBUG),1)
80b830cd sago007 2012-08-19 17:51 34
BASE_CFLAGS += -g -DDEBUG=1 -Wall
a039f5c4 sago007 2008-09-19 23:12 35
else
80b830cd sago007 2012-08-19 17:51 36
BASE_CFLAGS += -O3 
2f30c381 sago007 2008-09-14 13:08 37
endif
2f30c381 sago007 2008-09-14 13:08 38
2f30c381 sago007 2008-09-14 13:08 39
ifeq ($(NETWORK),1)
2f30c381 sago007 2008-09-14 13:08 40
BASE_CFLAGS += -DNETWORK=1
2f30c381 sago007 2008-09-14 13:08 41
BASE_LIBS += -lenet
2f30c381 sago007 2008-09-14 13:08 42
else
2f30c381 sago007 2008-09-14 13:08 43
BASE_CFLAGS += -DNETWORK=0
2f30c381 sago007 2008-09-14 13:08 44
endif
2f30c381 sago007 2008-09-14 13:08 45
a039f5c4 sago007 2008-09-19 23:12 46
BASE_LIBS += -lphysfs
a039f5c4 sago007 2008-09-19 23:12 47
1d2e2129 sago007 2015-12-23 15:41 48
OFILES=main.o highscore.o ReadKeyboard.o joypad.o listFiles.o common.o stats.o Libs/NFont.o Libs/SDL_FontCache.o MenuSystem.o menudef.o puzzlehandler.o ${SAGO_O_FILES}
f62f552d sago007 2008-08-29 14:34 49
fb6646e4 sago007 2014-09-11 16:30 50
ifeq ($(CROSS),i686-pc-mingw32-)
fb6646e4 sago007 2014-09-11 16:30 51
OFILES += winicon.res
e90165e3 sago007 2014-09-15 16:26 52
BINARY := $(BINARY).exe
fb6646e4 sago007 2014-09-11 16:30 53
endif
fb6646e4 sago007 2014-09-11 16:30 54
32c6e29e sago007 2014-01-22 18:55 55
$(BINARY): 	$(OFILES)
70f47bf7 sago007 2014-09-10 17:25 56
	$(CXX) -O -o $(BINARY) $(OFILES) $(BASE_LIBS)
32c6e29e sago007 2014-01-22 18:55 57
#-lphysfs
78d03b38 sago007 2008-11-13 19:56 58
fb6646e4 sago007 2014-09-11 16:30 59
winicon.res:	winicon.rc
fb6646e4 sago007 2014-09-11 16:30 60
	$(CROSS)windres winicon.rc -O coff -o winicon.res
fb6646e4 sago007 2014-09-11 16:30 61
32c6e29e sago007 2014-01-22 18:55 62
%.o : %.cpp
70f47bf7 sago007 2014-09-10 17:25 63
	$(CXX) -MD $(BASE_CFLAGS) -c -o $@ $<
32c6e29e sago007 2014-01-22 18:55 64
	@cp $*.d $*.P; \
32c6e29e sago007 2014-01-22 18:55 65
             sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
32c6e29e sago007 2014-01-22 18:55 66
                 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
32c6e29e sago007 2014-01-22 18:55 67
             rm -f $*.d
605138b3 sago007 2012-04-14 15:12 68
32c6e29e sago007 2014-01-22 18:55 69
-include *.P
605138b3 sago007 2012-04-14 15:12 70
78d03b38 sago007 2008-11-13 19:56 71
2f30c381 sago007 2008-09-14 13:08 72
run: $(BINARY)
32c6e29e sago007 2014-01-22 18:55 73
	cd $(GAMEDIR) && ./blockattack
f62f552d sago007 2008-08-29 14:34 74
f62f552d sago007 2008-08-29 14:34 75
clean:
fd234987 sago007 2015-12-25 09:34 76
	rm *.o *.P Libs/*.o Libs/*.P ; true
acd79baf sago007 2015-11-22 19:37 77
acd79baf sago007 2015-11-22 19:37 78
SOURCE_FILES = $(OFILES:.o=.cpp)
acd79baf sago007 2015-11-22 19:37 79
acd79baf sago007 2015-11-22 19:37 80
format:
ecef5838 sago007 2015-11-24 20:01 81
	astyle -t -j -y -c -k1 -z2 -A2 --pad-header $(SOURCE_FILES) 
1970-01-01 00:00 82