Last active
May 25, 2016 22:09
-
-
Save joeduffy/fe8a5ae322ffe63fac90535eb554237f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CSC=dotnet compile-csc | |
DOTNET=/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-3002702 | |
CSREFS=\ | |
--reference=$(DOTNET)/mscorlib.ni.dll \ | |
--reference=$(DOTNET)/System.Runtime.dll \ | |
--reference=$(DOTNET)/System.Console.dll | |
CSFLAGS=\ | |
--emit-entry-point \ | |
--warnings-as-errors \ | |
--temp-output=./temp | |
SOURCES=$(shell find src -type f -name '*.cs') | |
BIN=bin | |
DLL=hello.dll | |
DBGOUT=$(BIN)/debug | |
DBGDLL=$(DBGOUT)/$(DLL) | |
RELOUT=$(BIN)/release | |
RELDLL=$(RELOUT)/$(DLL) | |
.PHONY: debug | |
debug: CSFLAGS += --define=DEBUG | |
debug: $(DBGDLL) | |
.PHONY: release | |
release: CSFLAGS += --optimize | |
release: $(RELDLL) | |
$(DBGDLL): $(SOURCES) | |
mkdir -p $(DBGOUT) | |
$(CSC) $(CSFLAGS) $(SOURCES) $(CSREFS) --out=$(DBGDLL) | |
$(RELDLL): $(SOURCES) | |
mkdir -p $(RELOUT) | |
$(CSC) $(CSFLAGS) $(SOURCES) $(CSREFS) --out=$(RELDLL) | |
clean: | |
$(RM) -rf $(BIN) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment