-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (34 loc) · 1.03 KB
/
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
PROJECT=$(CURDIR)
MAINSRC=$(PROJECT)/src/main/cobol
TESTSRC=$(PROJECT)/src/test/cobol
MAINCPY=$(MAINSRC)
TESTCPY=$(TESTSRC)
MAINRSC=$(PROJECT)/src/main/resources
TESTRSC=$(PROJECT)/src/test/resources
TARGET=$(PROJECT)/target
export COBCPY=$(MAINCPY):$(TESTCPY)
export COB_LIBRARY_PATH=$(TARGET)
TESTNAME=TESTPRG
TESTPRG=$(TARGET)/$(TESTNAME).CBL
PROGRAM=FIZZBUZZ
CONFIG=FIZZBUZZC
UNITTESTS=FIZZBUZZT
export SRCPRG=$(MAINSRC)/$(PROGRAM).CBL
export TESTPRG=$(TARGET)/TESTPRG.CBL
export TESTNAME=TESTPRG
export UTSTCFG=$(TESTRSC)/$(CONFIG)
export UTESTS=$(TESTCPY)/$(UNITTESTS).CBL
all: clean test
clean:
rm -rf $(TARGET)
$(TARGET):
mkdir $(TARGET)
$(TARGET)/ZUTZCPC: $(TESTSRC)/ZUTZCPC.CBL
cobc -x -std=ibm -o $(TARGET)/ZUTZCPC $(TESTSRC)/ZUTZCPC.CBL
test: $(TARGET) $(TARGET)/ZUTZCPC
$(TARGET)/ZUTZCPC
cobc -x -std=ibm -o $(TARGET)/$(UNITTESTS) $(TESTPRG)
$(TARGET)/$(UNITTESTS)
$(TARGET)/$(PROGRAM): $(MAINSRC)/$(PROGRAM).CBL
cobc -x -std=ibm -o $(TARGET)/$(PROGRAM) $(MAINSRC)/$(PROGRAM).CBL
compile: $(TARGET) $(TARGET)/$(PROGRAM)