Skip to content

Commit

Permalink
Merge pull request #74 from Abscissa/generated-dir
Browse files Browse the repository at this point in the history
Separate "generated" dir, fixing dustmite build on OSX
  • Loading branch information
WalterBright committed Aug 12, 2013
2 parents 9fb74c7 + e0b471a commit 77cb68c
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 51 deletions.
79 changes: 55 additions & 24 deletions posix.mak
Expand Up @@ -5,25 +5,56 @@ PREFIX ?= /usr/local/bin
WITH_DOC ?= no
DOC ?= ../dlang.org/web

MODEL:=
OS:=
uname_S:=$(shell uname -s)
ifeq (Darwin,$(uname_S))
OS:=osx
endif
ifeq (Linux,$(uname_S))
OS:=linux
endif
ifeq (FreeBSD,$(uname_S))
OS:=freebsd
endif
ifeq (OpenBSD,$(uname_S))
OS:=openbsd
endif
ifeq (Solaris,$(uname_S))
OS:=solaris
endif
ifeq (SunOS,$(uname_S))
OS:=solaris
endif
ifeq (,$(OS))
$(error Unrecognized or unsupported OS for uname: $(uname_S))
endif

# For now, 32 bit is the default model
ifeq (,$(MODEL))
MODEL:=32
endif

ifneq (,$(MODEL))
MODEL_FLAG:=-m$(MODEL)
endif

ROOT_OF_THEM_ALL = generated
ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(MODEL)

TOOLS = \
rdmd \
ddemangle \
catdoc \
detab \
tolf
$(ROOT)/rdmd \
$(ROOT)/ddemangle \
$(ROOT)/catdoc \
$(ROOT)/detab \
$(ROOT)/tolf

CURL_TOOLS = \
dget \
changed
$(ROOT)/dget \
$(ROOT)/changed

DOC_TOOLS = \
findtags \
dman
$(ROOT)/findtags \
$(ROOT)/dman

TAGS:= \
expression.tag \
Expand All @@ -45,34 +76,34 @@ PHOBOS_TAGS:= \
std_traits.tag \
std_typetuple.tag

all: $(TOOLS) $(CURL_TOOLS) dustmite
all: $(TOOLS) $(CURL_TOOLS) $(ROOT)/dustmite

dustmite: DustMite/dustmite.d DustMite/dsplit.d
$(ROOT)/dustmite: DustMite/dustmite.d DustMite/dsplit.d
$(DMD) $(MODEL_FLAG) DustMite/dustmite.d DustMite/dsplit.d -of$(@)

#dreadful custom step because of libcurl dmd linking problem (Bugzilla 7044)
$(CURL_TOOLS): %: %.d
$(DMD) -c $(<)
($(DMD) -v $(@).o 2>&1 | grep gcc | cut -f2- -d' ' ; echo -lcurl ) | xargs $(CC)
$(CURL_TOOLS): $(ROOT)/%: %.d
$(DMD) -c -of$(@).o $(<)
($(DMD) -v -of$(@) $(@).o 2>&1 | grep gcc | cut -f2- -d' ' ; echo -lcurl ) | xargs $(CC)

$(TOOLS) $(DOC_TOOLS): %: %.d
$(DMD) $(MODEL_FLAG) $(DFLAGS) $(<)
$(TOOLS) $(DOC_TOOLS): $(ROOT)/%: %.d
$(DMD) $(MODEL_FLAG) $(DFLAGS) -of$(@) $(<)

$(TAGS): %.tag: $(DOC)/%.html findtags
./findtags $< > $@
$(TAGS): %.tag: $(DOC)/%.html $(ROOT)/findtags
$(ROOT)/findtags $< > $@

$(PHOBOS_TAGS): %.tag: $(DOC)/phobos/%.html findtags
./findtags $< > $@
$(PHOBOS_TAGS): %.tag: $(DOC)/phobos/%.html $(ROOT)/findtags
$(ROOT)/findtags $< > $@

dman: $(TAGS) $(PHOBOS_TAGS)
dman: DFLAGS += -J.
$(ROOT)/dman: $(TAGS) $(PHOBOS_TAGS)
$(ROOT)/dman: DFLAGS += -J.

install: $(TOOLS) $(CURL_TOOLS)
install -d $(DESTDIR)$(PREFIX)
install -t $(DESTDIR)$(PREFIX) $(^)

clean:
rm -f dustmite $(TOOLS) $(DOC_TOOLS) $(TAGS) *.o
rm -f $(ROOT)/dustmite $(TOOLS) $(DOC_TOOLS) $(TAGS) *.o $(ROOT)/*.o

ifeq ($(WITH_DOC),yes)
all install: $(DOC_TOOLS)
Expand Down
61 changes: 34 additions & 27 deletions win32.mak
Expand Up @@ -32,7 +32,14 @@ SCP=$(CP)

DFLAGS=-O -release

TARGETS=dman.exe findtags.exe rdmd.exe changed.exe dustmite.exe
ROOT_OF_THEM_ALL = generated
ROOT = $(ROOT_OF_THEM_ALL)\windows\32

TARGETS= $(ROOT)\dman.exe \
$(ROOT)\findtags.exe \
$(ROOT)\rdmd.exe \
$(ROOT)\dustmite.exe
#$(ROOT)\changed.exe \
MAKEFILES=win32.mak posix.mak

Expand All @@ -57,70 +64,70 @@ TAGS= expression.tag \

targets : $(TARGETS)

expression.tag : findtags.exe $(DOC)\expression.html
expression.tag : $(ROOT)\findtags.exe $(DOC)\expression.html
+findtags $(DOC)\expression.html >expression.tag


statement.tag : findtags.exe $(DOC)\statement.html
statement.tag : $(ROOT)\findtags.exe $(DOC)\statement.html
+findtags $(DOC)\statement.html >statement.tag

std_algorithm.tag : findtags.exe $(PHOBOSDOC)\std_algorithm.html
std_algorithm.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_algorithm.html
+findtags $(PHOBOSDOC)\std_algorithm.html >std_algorithm.tag

std_array.tag : findtags.exe $(PHOBOSDOC)\std_array.html
std_array.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_array.html
+findtags $(PHOBOSDOC)\std_array.html >std_array.tag

std_file.tag : findtags.exe $(PHOBOSDOC)\std_file.html
std_file.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_file.html
+findtags $(PHOBOSDOC)\std_file.html >std_file.tag

std_format.tag : findtags.exe $(PHOBOSDOC)\std_format.html
std_format.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_format.html
+findtags $(PHOBOSDOC)\std_format.html >std_format.tag

std_math.tag : findtags.exe $(PHOBOSDOC)\std_math.html
std_math.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_math.html
+findtags $(PHOBOSDOC)\std_math.html >std_math.tag

std_parallelism.tag : findtags.exe $(PHOBOSDOC)\std_parallelism.html
std_parallelism.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_parallelism.html
+findtags $(PHOBOSDOC)\std_parallelism.html >std_parallelism.tag

std_path.tag : findtags.exe $(PHOBOSDOC)\std_path.html
std_path.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_path.html
+findtags $(PHOBOSDOC)\std_path.html >std_path.tag

std_random.tag : findtags.exe $(PHOBOSDOC)\std_random.html
std_random.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_random.html
+findtags $(PHOBOSDOC)\std_random.html >std_random.tag

std_range.tag : findtags.exe $(PHOBOSDOC)\std_range.html
std_range.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_range.html
+findtags $(PHOBOSDOC)\std_range.html >std_range.tag

std_regex.tag : findtags.exe $(PHOBOSDOC)\std_regex.html
std_regex.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_regex.html
+findtags $(PHOBOSDOC)\std_regex.html >std_regex.tag

std_stdio.tag : findtags.exe $(PHOBOSDOC)\std_stdio.html
std_stdio.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_stdio.html
+findtags $(PHOBOSDOC)\std_stdio.html >std_stdio.tag

std_string.tag : findtags.exe $(PHOBOSDOC)\std_string.html
std_string.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_string.html
+findtags $(PHOBOSDOC)\std_string.html >std_string.tag

std_traits.tag : findtags.exe $(PHOBOSDOC)\std_traits.html
std_traits.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_traits.html
+findtags $(PHOBOSDOC)\std_traits.html >std_traits.tag

std_typetuple.tag : findtags.exe $(PHOBOSDOC)\std_typetuple.html
std_typetuple.tag : $(ROOT)\findtags.exe $(PHOBOSDOC)\std_typetuple.html
+findtags $(PHOBOSDOC)\std_typetuple.html >std_typetuple.tag


findtags.exe : findtags.d
$(DMD) findtags.d
$(ROOT)\findtags.exe : findtags.d
$(DMD) -of$@ findtags.d

dman.exe : dman.d $(TAGS)
$(DMD) $(DFLAGS) dman.d -J.
$(ROOT)\dman.exe : dman.d $(TAGS)
$(DMD) $(DFLAGS) -of$@ dman.d -J.

rdmd.exe : rdmd.d
$(DMD) $(DFLAGS) rdmd.d advapi32.lib
$(ROOT)\rdmd.exe : rdmd.d
$(DMD) $(DFLAGS) -of$@ rdmd.d advapi32.lib

dustmite.exe : DustMite/dustmite.d DustMite/dsplit.d
$(DMD) $(DFLAGS) DustMite/dustmite.d DustMite/dsplit.d -of$@
$(ROOT)\dustmite.exe : DustMite/dustmite.d DustMite/dsplit.d
$(DMD) $(DFLAGS) -of$@ DustMite/dustmite.d DustMite/dsplit.d

changed.exe : changed.d
$(DMD) $(DFLAGS) changed.d
$(ROOT)\changed.exe : changed.d
$(DMD) $(DFLAGS) -of$@ changed.d

clean :
del $(TARGETS) $(TAGS)
Expand Down

0 comments on commit 77cb68c

Please sign in to comment.