git repos / PlatformFolders

blame: Makefile

normal view · raw

1213f3f3 sago007 2015-09-19 19:24 1
CC=$(CROSS)gcc
1213f3f3 sago007 2015-09-19 19:24 2
CXX=$(CROSS)g++
1213f3f3 sago007 2015-09-19 19:24 3
LD=$(CROSS)ld
1213f3f3 sago007 2015-09-19 19:24 4
AR=$(CROSS)ar
1213f3f3 sago007 2015-09-19 19:24 5
PKG_CONFIG=$(CROSS)pkg-config
1213f3f3 sago007 2015-09-19 19:24 6
1213f3f3 sago007 2015-09-19 19:24 7
BASE_LIBS=
1213f3f3 sago007 2015-09-19 19:24 8
BASE_CFLAGS=-c -g -O2 -Wall
1213f3f3 sago007 2015-09-19 19:24 9
1213f3f3 sago007 2015-09-19 19:24 10
#The files should compile on both C++03 and C++11
1213f3f3 sago007 2015-09-19 19:24 11
ifdef TESTCPP11
1213f3f3 sago007 2015-09-19 19:24 12
BASE_CFLAGS+= -std=c++11
1213f3f3 sago007 2015-09-19 19:24 13
else
1213f3f3 sago007 2015-09-19 19:24 14
BASE_CFLAGS+= -std=c++03
1213f3f3 sago007 2015-09-19 19:24 15
endif
1213f3f3 sago007 2015-09-19 19:24 16
1eaaab72 sago007 2015-10-26 17:23 17
#This is used to detect Mac because Mac needs CoreServices for linking
1eaaab72 sago007 2015-10-26 17:23 18
ifneq ($(OS),Windows_NT)
1eaaab72 sago007 2015-10-26 17:23 19
UNAME := $(shell uname -s)
1eaaab72 sago007 2015-10-26 17:23 20
ifeq ($(UNAME),Darwin)
1eaaab72 sago007 2015-10-26 17:23 21
BASE_LIBS+= -framework CoreServices
1eaaab72 sago007 2015-10-26 17:23 22
endif
1eaaab72 sago007 2015-10-26 17:23 23
endif
1eaaab72 sago007 2015-10-26 17:23 24
1213f3f3 sago007 2015-09-19 19:24 25
PROGRAMNAME=platform_folders
1213f3f3 sago007 2015-09-19 19:24 26
1213f3f3 sago007 2015-09-19 19:24 27
O_FILES=${PROGRAMNAME}.o sago/platform_folders.o
1213f3f3 sago007 2015-09-19 19:24 28
344d62f1 sago007 2015-09-20 11:42 29
total: ${PROGRAMNAME}.out
1213f3f3 sago007 2015-09-19 19:24 30
1213f3f3 sago007 2015-09-19 19:24 31
clean: 
63627d7a sago007 2015-09-20 18:08 32
	rm -f */*.o *.o *.P */*.P ${PROGRAMNAME}.out
1213f3f3 sago007 2015-09-19 19:24 33
344d62f1 sago007 2015-09-20 11:42 34
${PROGRAMNAME}.out: $(O_FILES)
344d62f1 sago007 2015-09-20 11:42 35
	$(CXX) -O -o ${PROGRAMNAME}.out $(O_FILES) $(BASE_LIBS)
1213f3f3 sago007 2015-09-19 19:24 36
1213f3f3 sago007 2015-09-19 19:24 37
%.o : %.cpp
1213f3f3 sago007 2015-09-19 19:24 38
	$(CXX) -MD ${BASE_CFLAGS} -o $@ $<
1213f3f3 sago007 2015-09-19 19:24 39
	@mkdir -p `dirname .$(CROSS)deps/$*.P` && cp $*.d .$(CROSS)deps/$*.P; \
1213f3f3 sago007 2015-09-19 19:24 40
             sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
1213f3f3 sago007 2015-09-19 19:24 41
                 -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> .$(CROSS)deps/$*.P; \
1213f3f3 sago007 2015-09-19 19:24 42
             rm -f $*.d
1213f3f3 sago007 2015-09-19 19:24 43
1213f3f3 sago007 2015-09-19 19:24 44
-include .$(CROSS)deps/*.P
1970-01-01 00:00 45