stratgame

diff gfx/Makefile @ 3:8d95187cb3ee

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 23 May 2012 17:10:46 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/Makefile	Wed May 23 17:10:46 2012 +0300
     1.3 @@ -0,0 +1,28 @@
     1.4 +csrc = $(wildcard src/*.c)
     1.5 +ccsrc = $(wildcard src/*.cc)
     1.6 +obj = $(ccsrc:.cc=.o) $(csrc:.c=.o)
     1.7 +dep = $(obj:.o=.d)
     1.8 +lib_a = libgfx.a
     1.9 +
    1.10 +CFLAGS = -pedantic -Wall -g -I../common/src
    1.11 +CXXFLAGS = -std=c++0x $(CFLAGS)
    1.12 +
    1.13 +ifeq ($(shell uname -s), Darwin)
    1.14 +	CC = clang
    1.15 +	CXX = clang++
    1.16 +endif
    1.17 +
    1.18 +$(lib_a): $(obj)
    1.19 +	$(AR) rcs $@ $(obj)
    1.20 +
    1.21 +-include $(dep)
    1.22 +
    1.23 +%.d: %.c
    1.24 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.25 +
    1.26 +%.d: %.cc
    1.27 +	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.28 +
    1.29 +.PHONY: clean
    1.30 +clean:
    1.31 +	rm -f $(obj) $(bin) $(dep)