diff options
| author | Mike Wey | 2011-07-09 23:29:16 +0200 |
|---|---|---|
| committer | Mike Wey | 2011-07-09 23:29:16 +0200 |
| commit | 06816cac1ddb330e19e2bbe884d249526212ccba (patch) | |
| tree | 46e33f8929afbd890497683fb84b78a137c87b0b /GNUmakefile | |
| parent | 3eb55007a682d1eb94ba6a1fb0fe0b4652b8a120 (diff) | |
Turn some of the options into variables
Diffstat (limited to 'GNUmakefile')
| -rw-r--r-- | GNUmakefile | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/GNUmakefile b/GNUmakefile index 5422876..10b3bec 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -17,23 +17,21 @@ ifndef DC endif endif -ifeq ("$(DC)","dmd") - DCFLAGS=-O - LINKERFLAG=-L - output=-of$@ -else ifeq ("$(DC)","ldc") - DCFLAGS=-O - LINKERFLAG=-L - output=-of$@ -else +ifeq ("$(DC)","gdc") DCFLAGS=-O2 LINKERFLAG=-Xlinker + UNITTESTFLAG=-funittest + DDOCFLAGS=-fdoc-file=$@ output=-o $@ +else + DCFLAGS=-O + LINKERFLAG=-L + UNITTESTFLAG=-unittest + DDOCFLAGS=-o- -Df$@ + output=-of$@ endif -ifeq ("$(OS)","Darwin") - LDFLAGS+=-Wl,-undefined,dynamic_lookup -else ifeq ("$(OS)","Linux") +ifeq ("$(OS)","Linux") LDFLAGS+=$(LINKERFLAG)-ldl endif @@ -69,13 +67,11 @@ $(LIBNAME_DMAGICK): $(OBJECTS_DMAGICK) ####################################################################### -/tmp/stubmain.o: +/tmp/stubmain.d: $(shell echo "void main(){}" > /tmp/stubmain.d) - $(DC) $(DCFLAGS) -c /tmp/stubmain.d $(output) -unittest: DCFLAGS+=-unittest -unittest: /tmp/stubmain.o $(SOURCES_DMAGICK) - $(DC) $(DCFLAGS) -L-lMagickCore $(SOURCES_DMAGICK) $< $(output) +unittest: /tmp/stubmain.d $(SOURCES_DMAGICK) + $(DC) $(DCFLAGS) $(UNITTESTFLAG) $(LINKERFLAG)-lMagickCore $(SOURCES_DMAGICK) $< $(output) ./$@ ####################################################################### @@ -86,7 +82,7 @@ docs: $(DOCS_DMAGICK) ####################################################################### docs/%.html : dmagick/%.d - $(DC) $(DCFLAGS) -o- $< -Df$@ + $(DC) $(DCFLAGS) $< $(DDOCFLAGS) ####################################################################### @@ -101,4 +97,4 @@ uninstall: rm -f $(DESTDIR)$(prefix)/lib/$(LIBNAME_DMAGICK) clean: - -rm -rf $(LIBNAME_DMAGICK) $(OBJECTS_DMAGICK) docs + -rm -rf $(LIBNAME_DMAGICK) $(OBJECTS_DMAGICK) unittest.o unittest docs |
