X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/blobdiff_plain/2e05ad088dcc9c1522910bf3ae65d9d3240fb778..9fac8d774138f03d80061c243400b67b48879fd5:/Makefile diff --git a/Makefile b/Makefile index 1868ac9..32232ef 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,7 @@ +# Build directory +B := build + # D compiler to use DC := ldc @@ -29,29 +32,36 @@ LD_OUTPUT_OPTION = -o $@ # GC sources sources := \ - gc.d \ - gcalloc.d \ - gcbits.d \ - gcstats.d \ - gcx.d + gc/iface.d \ + gc/alloc.d \ + gc/bits.d \ + gc/stats.d \ + gc/libc.d \ + gc/gc.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) +