xDg

git clone git://xatko.vsos.ethz.ch/xDg.git
Log | Files | Refs

Makefile (1081B)


      1 DMD ?= dmd
      2 DEBUG ?= -g
      3 RELEASE ?= -release
      4 DFLAGS ?= -O
      5 INCLUDES = src
      6 SRC := $(wildcard src/xdg/*.d )
      7 TARGET = xdg
      8 LIBS = magic
      9 
     10 _DFLAGS := $(addprefix -I, $(INCLUDES)) $(addprefix -L-l, $(LIBS)) $(DFLAGS)
     11 
     12 .PHONY: all shared static clean distclean
     13 
     14 all: shared static xdg-open
     15 
     16 xdg-open: src/open.o lib$(TARGET).a
     17 	$(DMD) $(_DFLAGS) $(RELEASE) -of$@ $^
     18 	strip $@ || true
     19 
     20 shared: lib$(TARGET)-debug.so lib$(TARGET).so
     21 static: lib$(TARGET)-debug.a lib$(TARGET).a
     22 
     23 lib$(TARGET).a: $(patsubst %.d,%.o,$(SRC))
     24 	$(DMD) $(_DFLAGS) $(RELEASE) -lib -of$@ $^
     25 lib$(TARGET)-debug.a: $(patsubst %.d, %-debug.o,$(SRC))
     26 	$(DMD) $(_DFLAGS) $(DEBUG) -lib -of$@ $^
     27 lib$(TARGET).so: $(patsubst %.d, %.o, $(SRC))
     28 	$(DMD) $(_DFLAGS) $(RELEASE) -shared -of$@ $^
     29 lib$(TARGET)-debug.so: $(patsubst %.d, %-debug.o, $(SRC))
     30 	$(DMD) $(_DFLAGS) $(DEBUG) -shared -of$@ $^
     31 
     32 %.o:%.d
     33 	$(DMD) $(_DFLAGS) $(RELEASE) -c -of$@ $<
     34 %-debug.o:%.d
     35 	$(DMD) $(_DFLAGS) $(DEBUG) -c -of$@ $<
     36 
     37 clean:
     38 	rm -f $(patsubst %.d, %.o, $(SRC)) $(patsubst %.d,%-debug.o,$(SRC))
     39 distclean: clean
     40 	rm -f lib$(TARGET){,-debug}.{so,a}