Permalink
Browse files

posix.mak added

  • Loading branch information...
1 parent 9da128f commit f7764f2d51d2d0ef0545e3329c82c9385098f50a @ony ony committed Oct 25, 2012
Showing with 59 additions and 3 deletions.
  1. +9 −3 .gitignore
  2. +50 −0 posix.mak
View
12 .gitignore
@@ -1,5 +1,11 @@
*.o
-catdoc
-dman
-rdmd
+*.tag
+/catdoc
+/dman
+/rdmd
+/ddemangle
+/dget
+/tolf
+/findtags
+/detab
View
50 posix.mak
@@ -0,0 +1,50 @@
+DMD ?= dmd
+PREFIX ?= /usr/local/bin
+
+WITH_DOC ?= no
+DOC ?= ../d-programming-language.org/web
+
+MODEL = 32
+ifneq (,$(MODEL))
+ MODEL_FLAG ?= -m$(MODEL)
+endif
+
+TOOLS = \
+ rdmd \
+ ddemangle \
+ dget \
+ catdoc \
+ detab \
+ tolf
+
+DOC_TOOLS = \
+ findtags \
+ dman
+
+TAGS = \
+ expression.tag \
+ statement.tag
+
+all: $(TOOLS)
+
+$(TOOLS) $(DOC_TOOLS): %: %.d
+ $(DMD) $(MODEL_FLAG) $(DFLAGS) $(<)
+
+$(TAGS): %.tag: $(DOC)/%.html findtags
+ ./findtags $(filter %.html,$(^)) > $(@)
+
+dman: $(TAGS)
+dman: DFLAGS += -J.
+
+install: $(TOOLS)
+ install -d $(DESTDIR)$(PREFIX)
+ install -t $(DESTDIR)$(PREFIX) $(^)
+
+clean:
+ rm -f $(TOOLS) $(DOC_TOOLS) $(TAGS) *.o
+
+ifeq ($(WITH_DOC),yes)
+all install: $(DOC_TOOLS)
+endif
+
+.PHONY: all install clean

0 comments on commit f7764f2

Please sign in to comment.