DMD_ROOT_SRC := \ $(shell find dmd/compiler/src/dmd/common -name "*.d")\ $(shell find dmd/compiler/src/dmd/root -name "*.d") DMD_LEXER_SRC := \ dmd/compiler/src/dmd/console.d \ dmd/compiler/src/dmd/entity.d \ dmd/compiler/src/dmd/errors.d \ dmd/compiler/src/dmd/errorsink.d \ dmd/compiler/src/dmd/location.d \ dmd/compiler/src/dmd/file_manager.d \ dmd/compiler/src/dmd/globals.d \ dmd/compiler/src/dmd/id.d \ dmd/compiler/src/dmd/identifier.d \ dmd/compiler/src/dmd/lexer.d \ dmd/compiler/src/dmd/tokens.d \ dmd/compiler/src/dmd/utils.d \ $(DMD_ROOT_SRC) DMD_PARSER_SRC := \ dmd/compiler/src/dmd/astbase.d \ dmd/compiler/src/dmd/parse.d \ dmd/compiler/src/dmd/parsetimevisitor.d \ dmd/compiler/src/dmd/transitivevisitor.d \ dmd/compiler/src/dmd/permissivevisitor.d \ dmd/compiler/src/dmd/strictvisitor.d \ dmd/compiler/src/dmd/astenums.d \ $(DMD_LEXER_SRC) SRC := $(shell find src -name "*.d") \ $(shell find stdx-allocator/source -name "*.d") \ $(DMD_PARSER_SRC) INCLUDE_PATHS := -Ilibdparse/src -Istdx-allocator/source -Isrc -Idmd/compiler/src -Jbin -Jdmd DMD_COMMON_FLAGS := -w $(INCLUDE_PATHS) DMD_DEBUG_FLAGS := -debug -g $(DMD_COMMON_FLAGS) DMD_FLAGS := -O -inline $(DMD_COMMON_FLAGS) DMD_TEST_FLAGS := -unittest -g $(DMD_COMMON_FLAGS) LDC_FLAGS := -g -w -oq $(INCLUDE_PATHS) GDC_FLAGS := -g -w -oq $(INCLUDE_PATHS) override DMD_FLAGS += $(DFLAGS) override LDC_FLAGS += $(DFLAGS) override GDC_FLAGS += $(DFLAGS) DC ?= dmd LDC ?= ldc2 GDC ?= gdc .PHONY: dmd ldc gdc test dmd: bin/dfmt githash: mkdir -p bin git describe --tags > bin/githash.txt ldc: githash $(LDC) $(SRC) $(LDC_FLAGS) -ofbin/dfmt -rm -f *.o gdc:githash $(GDC) $(SRC) $(GDC_FLAGS) -obin/dfmt test: debug cd tests && ./test.d bin/dfmt-test: githash $(SRC) $(DC) $(DMD_TEST_FLAGS) $^ -of$@ bin/dfmt: githash $(SRC) $(DC) $(DMD_FLAGS) $(filter %.d,$^) -of$@ debug: githash $(SRC) $(DC) $(DMD_DEBUG_FLAGS) $(filter %.d,$^) -ofbin/dfmt pkg: dmd $(MAKE) -f makd/Makd.mak pkg clean: $(RM) bin/dfmt release: ./release.sh githash