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
b81f58ad sago007 2015-12-25 22:48 21
BASE_LIBS=$(shell $(CROSS)sdl2-config --libs) $(shell $(CROSS)pkg-config SDL2_image SDL2_mixer SDL2_ttf --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)
048bc0fb sago007 2015-12-25 09:59 34
BASE_CFLAGS += -g -DDEBUG=1 -Wall -Wno-sign-compare
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
b81f58ad sago007 2015-12-25 22:48 46
ifeq ($(CROSS),i686-w64-mingw32.static-)
b81f58ad sago007 2015-12-25 22:48 47
BASE_LIBS += -lws2_32
b81f58ad sago007 2015-12-25 22:48 48
endif
b81f58ad sago007 2015-12-25 22:48 49
b81f58ad sago007 2015-12-25 22:48 50
a039f5c4 sago007 2008-09-19 23:12 51
BASE_LIBS += -lphysfs
a039f5c4 sago007 2008-09-19 23:12 52
1d2e2129 sago007 2015-12-23 15:41 53
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 54
b81f58ad sago007 2015-12-25 22:48 55
ifeq ($(CROSS),i686-w64-mingw32.static-)
fb6646e4 sago007 2014-09-11 16:30 56
OFILES += winicon.res
e90165e3 sago007 2014-09-15 16:26 57
BINARY := $(BINARY).exe
fb6646e4 sago007 2014-09-11 16:30 58
endif
fb6646e4 sago007 2014-09-11 16:30 59
32c6e29e sago007 2014-01-22 18:55 60
$(BINARY): 	$(OFILES)
70f47bf7 sago007 2014-09-10 17:25 61
	$(CXX) -O -o $(BINARY) $(OFILES) $(BASE_LIBS)
32c6e29e sago007 2014-01-22 18:55 62
#-lphysfs
78d03b38 sago007 2008-11-13 19:56 63
fb6646e4 sago007 2014-09-11 16:30 64
winicon.res:	winicon.rc
fb6646e4 sago007 2014-09-11 16:30 65
	$(CROSS)windres winicon.rc -O coff -o winicon.res
fb6646e4 sago007 2014-09-11 16:30 66
32c6e29e sago007 2014-01-22 18:55 67
%.o : %.cpp
70f47bf7 sago007 2014-09-10 17:25 68
	$(CXX) -MD $(BASE_CFLAGS) -c -o $@ $<
32c6e29e sago007 2014-01-22 18:55 69
	@cp $*.d $*.P; \
32c6e29e sago007 2014-01-22 18:55 70
             sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
32c6e29e sago007 2014-01-22 18:55 71
                 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
32c6e29e sago007 2014-01-22 18:55 72
             rm -f $*.d
605138b3 sago007 2012-04-14 15:12 73
32c6e29e sago007 2014-01-22 18:55 74
-include *.P
605138b3 sago007 2012-04-14 15:12 75
78d03b38 sago007 2008-11-13 19:56 76
2f30c381 sago007 2008-09-14 13:08 77
run: $(BINARY)
32c6e29e sago007 2014-01-22 18:55 78
	cd $(GAMEDIR) && ./blockattack
f62f552d sago007 2008-08-29 14:34 79
f62f552d sago007 2008-08-29 14:34 80
clean:
b81f58ad sago007 2015-12-25 22:48 81
	rm *.o *.P Libs/*.o Libs/*.P sago/*.o sago/*.P ; true
acd79baf sago007 2015-11-22 19:37 82
acd79baf sago007 2015-11-22 19:37 83
SOURCE_FILES = $(OFILES:.o=.cpp)
acd79baf sago007 2015-11-22 19:37 84
acd79baf sago007 2015-11-22 19:37 85
format:
ecef5838 sago007 2015-11-24 20:01 86
	astyle -t -j -y -c -k1 -z2 -A2 --pad-header $(SOURCE_FILES) 
1970-01-01 00:00 87