From 9aada2930522a2ef5f46d66e947b7b535ecb1b75 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 24 Dec 2009 20:20:57 -0300 Subject: [PATCH] Put built stuff in a separated build directory --- .gitignore | 3 +-- Makefile | 16 +++++++++++----- cdgcrun | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 01d1dee..567609b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -*.o -cdgc.so +build/ diff --git a/Makefile b/Makefile index 1868ac9..90a932f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,7 @@ +# Build directory +B := build + # D compiler to use DC := ldc @@ -36,22 +39,25 @@ sources := \ 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) $< + +__dummy := $(shell mkdir -p $B) + diff --git a/cdgcrun b/cdgcrun index 85a0bf7..d40a699 100755 --- a/cdgcrun +++ b/cdgcrun @@ -5,6 +5,6 @@ # # To run "myprogram my arguments" using the CDGC. -export LD_PRELOAD=./cdgc.so +export LD_PRELOAD=./build/cdgc.so exec "$@" -- 2.43.0