X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/blobdiff_plain/2e05ad088dcc9c1522910bf3ae65d9d3240fb778..876c4089652c85740c66a62899a1e32837e15ad5:/Makefile diff --git a/Makefile b/Makefile index 1868ac9..736862e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,7 @@ +# Build directory +B := build + # D compiler to use DC := ldc @@ -28,30 +31,38 @@ LD_OUTPUT_OPTION = -o $@ #LDFLAGS := # GC sources -sources := \ +sources := $(addprefix rt/gc/cdgc/,\ + iface.d \ + alloc.d \ + bits.d \ + stats.d \ + libc.d \ gc.d \ - gcalloc.d \ - gcbits.d \ - gcstats.d \ - gcx.d + ) # Default target -all: cdgc.so +all: $B/cdgc.so # Make the GC shared object -cdgc.so: $(sources:.d=.o) +$B/cdgc.so: $(patsubst %.d,$B/%.o,$(sources)) # General pattern rules ####################### -%.so: DCFLAGS += $(DC_SO_OPT) +$B/%.so: DCFLAGS += $(DC_SO_OPT) -%.so: +$B/%.so: $(if $V,,@echo ' $(LD) $@') $(if $V,,@) $(LD) $(LDFLAGS) $(LD_SO_OPT) $(LD_OUTPUT_OPTION) $^ -%.o: %.d +$B/%.o: %.d $(if $V,,@echo ' $(DC) $@') $(if $V,,@) $(DC) $(DCFLAGS) $(DC_OBJ_OPT) $(DC_OUTPUT_OPTION) $< +clean: + $(if $V,,@echo ' $(RM) $B') + $(if $V,,@) $(RM) -r $B + +__dummy := $(shell mkdir -p $B) +