Makefile (1612B)
1 ## Copyright 2013 Brian Swetland <swetland@frotz.net> 2 ## 3 ## Licensed under the Apache License, Version 2.0 (the "License"); 4 ## you may not use this file except in compliance with the License. 5 ## You may obtain a copy of the License at 6 ## 7 ## http://www.apache.org/licenses/LICENSE-2.0 8 ## 9 ## Unless required by applicable law or agreed to in writing, software 10 ## distributed under the License is distributed on an "AS IS" BASIS, 11 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 ## See the License for the specific language governing permissions and 13 ## limitations under the License. 14 15 what_to_build:: all 16 17 -include local.mk 18 19 SDLCFG := /work/sdl2/bin/sdl2-config 20 21 SDLFLAGS := $(shell $(SDLCFG) --cflags) 22 #SDLLIBS := $(shell $(SDLCFG) --static-libs) 23 SDLLIBS := /work/sdl2/lib/libSDL2.a -lpthread -lrt -ldl 24 25 HOST_CFLAGS := $(SDLFLAGS) -Wall -g -O0 26 HOST_CFLAGS += -std=c++0x 27 HOST_CFLAGS += -Icommon 28 HOST_CFLAGS += -Ithirdparty/freetype-2.5.0.1/include 29 #HOST_CFLAGS += -ffunction-sections -fdata-sections 30 31 HOST_LFLAGS := -static-libstdc++ 32 #HOST_LFLAGS += -Wl,--verbose 33 #HOST_LFLAGS += -Wl,-gc-sections 34 35 HOST_LIBS := $(SDLLIBS) -lm -lpng 36 37 include $(wildcard arch/*/config.mk) 38 39 OUT := out 40 OUT_OBJ := $(OUT)/_obj 41 OUT_LIB := $(OUT)/_lib 42 43 ALL := 44 DEPS := 45 46 MKDIR = if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi 47 48 QUIET ?= @ 49 50 modulepath = $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) 51 52 # additional modules 53 include $(wildcard */module.mk) 54 55 clean:: 56 @echo clean 57 @rm -rf $(OUT) 58 59 # we generate .d as a side-effect of compiling. override generic rule: 60 %.d: 61 -include $(DEPS) 62 63 all:: $(ALL) 64