Skip to content

Instantly share code, notes, and snippets.

@matovitch
Forked from wolfiestyle/Makefile
Last active December 18, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matovitch/5700593 to your computer and use it in GitHub Desktop.
Save matovitch/5700593 to your computer and use it in GitHub Desktop.
# basic makefile for D language - made by darkstalker slightly modified by matovitch
DCC=dmd
DFLAGS= -w
LIBS=
SRC= $(wildcard *.d)
OBJ= $(SRC:.d=.o)
INT= $(SRC:.d=.di)
DOC= $(SRC:.d=.html)
OUT= $(shell basename `pwd`)
.PHONY: all debug release profile clean doc
all: debug
debug: DFLAGS += -g -debug
release: DFLAGS += -O -release -inline -noboundscheck
profile: DFLAGS += -g -O -profile
debug release profile: $(OUT)
$(OUT): $(INT) $(OBJ)
$(DCC) $(DFLAGS) -of$@ $(OBJ) $(LIBS)
%.o: %.d %.di
$(DCC) $(DFLAGS) -c $<
$(INT):
$(DCC) $(DFLAGS) -c -o- -H $(SRC)
doc:
$(DCC) $(DFLAGS) -c -o- -D $(SRC)
clean:
rm -f *~ $(DOC) $(INT) $(OBJ) $(OUT) trace.{def,log}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment