forked from christophevg/cobol-object-mapper
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
46 lines (33 loc) · 849 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
INPUT ?= assets/example.cobol
OUTPUT ?= $(INPUT).png
TARGET = main
BUILD = .build
CC = mcs
RUN = mono
NUNIT = nunit-console -nologo
DOT = unflatten -f -l 1 -c 4 | dot -T png -o
ifdef DEBUG
RUN += --debug
CFLAGS += -define:DEBUG -debug
endif
ifdef CSHARP_VERSION
CFLAGS += -langversion:$(CSHARP_VERSION)
endif
all: run
$(BUILD)/%.exe: src/*.cs
@mkdir -p $(BUILD)
@$(CC) $(CFLAGS) -out:$@ $^
run: $(BUILD)/$(TARGET).exe
@$(RUN) $< $(INPUT)
$(BUILD)/test.dll: test/test_*.cs src/*.cs
@echo "*** building $@"
@mkdir -p $(BUILD)
@$(CC) $(CFLAGS) -t:library -r:nunit.framework.dll -out:$@ $^
test: $(BUILD)/test.dll
@$(NUNIT) $<
dot: $(BUILD)/$(TARGET).exe
@$(RUN) $< -d $(INPUT) | $(DOT) $(OUTPUT)
clean:
@rm -rf $(BUILD) TestResult.xml
-include Makefile.local
.PHONY: test