BastliBridge

git clone git://xatko.vsos.ethz.ch/BastliBridge.git
Log | Files | Refs | Submodules | README

Makefile (1315B)


      1 DMD ?= ldmd2
      2 DEBUG ?= -g -Xcc=-rdynamic
      3 RELEASE ?= -release -O -d-version=StdLoggerDisableTrace
      4 DFLAGS ?=
      5 INCLUDES = Dirk/source/ src Dirk/libev Dirk/ssl
      6 SRC := $(wildcard src/bastlibridge/*.d) $(wildcard src/telegram/*.d) $(wildcard src/bastlibridge/*/*.d)  $(wildcard Dirk/source/*/*.d) Dirk/libev/deimos/ev.d
      7 TARGET = bastlibridge
      8 LIBS = ev
      9 
     10 TARGET2 = bastliproxy
     11 SRC2 = $(wildcard src/bastliproxy/*.d) $(wildcard src/telegram/*.d) $(wildcard Dirk/source/ssl/*.d Dirk/source/loader/*.d) src/proxy.d
     12 
     13 _DFLAGS := $(addprefix -I, $(INCLUDES)) $(addprefix -L-l, $(LIBS)) $(DFLAGS)
     14 
     15 .PHONY: all shared static clean distclean
     16 
     17 all: $(TARGET)-debug
     18 
     19 $(TARGET): $(patsubst %.d, %.o, $(SRC))
     20 	$(DMD) $^ $(_DFLAGS) $(RELEASE) -of$@
     21 	strip -s $@
     22 $(TARGET)-debug: $(patsubst %.d, %-debug.o, $(SRC))
     23 	$(DMD) $^ $(_DFLAGS) $(DEBUG) -of$@
     24 
     25 $(TARGET2)-debug: $(patsubst %.d, %-debug.o, $(SRC2))
     26 	$(DMD) $^ -I src $(DEBUG) -of$@
     27 $(TARGET2): $(patsubst %.d, %.o, $(SRC2))
     28 	$(DMD) $^ -I src $(RELEASE) -of$@
     29 
     30 %.o:%.d
     31 	$(DMD) $(_DFLAGS) $(RELEASE) -c -of$@ $<
     32 %-debug.o:%.d
     33 	$(DMD) $(_DFLAGS) $(DEBUG) -c -of$@ $<
     34 
     35 clean:
     36 	rm -f $(patsubst %.d, %.o, $(SRC)) $(patsubst %.d,%-debug.o,$(SRC))
     37 	rm -f $(patsubst %.d, %.o, $(SRC2)) $(patsubst %.d,%-debug.o,$(SRC2))
     38 distclean: clean
     39 	rm -f $(TARGET){,-debug}
     40 	rm -f $(TARGET2){,-debug}