-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile.in
127 lines (98 loc) · 4.11 KB
/
Makefile.in
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
LIBRARY=@LIBRARY@
DBGVIEW=@DEBUG@
TGTRLS=@TARGET_RELEASE@
COMMON=\
plugconf.module \
plugbug.module \
plugipc.module \
plugrun.module \
plugperf.module \
plugcach.module \
plugerr.module \
plugsql.module \
plugdb2.module \
plugpase.module \
pluglic.module \
plugsig.module \
plugconv.module \
plugxml.module \
plugile.module
TEST_PGMS=\
zzbigboy.pgm \
zzcall.pgm \
zzcust.pgm \
zzdeep.pgm \
zzerich.pgm \
zzjava.pgm \
zzjava2.pgm \
zzmore.pgm \
zznone.pgm \
zzshlomo.pgm \
zzsimp.pgm \
zzvlad.pgm \
zzvlad2.pgm \
zzvlad3.pgm
TEST_SRVPGMS=\
zzsrv.srvpgm \
zzsrv6.srvpgm
XMLSTOREDP_MODULES=xmlstoredp.module $(COMMON)
# Ensure that intermediate files created by rules chains don't get
# automatically deleted
.PRECIOUS: %.module %.srcpf %.lib
all: build
prod: build-main build-procedure build-cgi prod-clean
build: build-main build-procedure build-cgi build-test
build-main: $(LIBRARY).lib xmlmain.pgm xmlservice.pgm xmlver.pgm
build-procedure: $(LIBRARY).lib xmlstoredp.srvpgm xmlstoredp.sqlinst
build-cgi: $(LIBRARY).lib xmlcgi.pgm
build-test: $(TEST_PGMS) $(TEST_SRVPGMS)
prod-clean:
rm -f *.module *.srcpf
rm -rf /qsys.lib/$(LIBRARY).lib/*.FILE
rm -rf /qsys.lib/$(LIBRARY).lib/*.MODULE
clean:
rm -f *.lib *.pgm *.srvpgm *.module *.sqlinst *.srcpf
system -q 'DLTLIB $(LIBRARY)' || :
xmlmain.pgm: xmlmain.module $(COMMON)
system -q "CRTPGM PGM($(LIBRARY)/$(@:%.pgm=%)) MODULE($(^:%.module=$(LIBRARY)/%)) TGTRLS($(TGTRLS))" && touch $@
xmlservice.pgm: xmlservice.module $(COMMON)
system -q "CRTPGM PGM($(LIBRARY)/$(@:%.pgm=%)) MODULE($(^:%.module=$(LIBRARY)/%)) TGTRLS($(TGTRLS))" && touch $@
xmlver.pgm: xmlver.module
system -q "CRTPGM PGM($(LIBRARY)/$(@:%.pgm=%)) MODULE($(^:%.module=$(LIBRARY)/%)) TGTRLS($(TGTRLS))" && touch $@
xmlcgi.pgm: xmlcgi.module $(COMMON)
system -q "CRTPGM PGM($(LIBRARY)/$(@:%.pgm=%)) MODULE($(^:%.module=$(LIBRARY)/%)) BNDSRVPGM(QHTTPSVR/QZSRCORE) TGTRLS($(TGTRLS))" && touch $@
xmlstoredp.srvpgm: qsrvsrc.srcpf $(XMLSTOREDP_MODULES)
system -q "CPYFRMSTMF FROMSTMF('src/$(@:%.srvpgm=%).bnd') TOMBR('/qsys.lib/$(LIBRARY).lib/qsrvsrc.file/$(@:%.srvpgm=%).mbr') MBROPT(*REPLACE)"
system -q "CRTSRVPGM SRVPGM($(LIBRARY)/$(@:%.srvpgm=%)) MODULE($(XMLSTOREDP_MODULES:%.module=$(LIBRARY)/%)) EXPORT(*SRCFILE) SRCFILE($(LIBRARY)/QSRVSRC) ACTGRP(*CALLER) TGTRLS($(TGTRLS))" && touch $@
%.pgm: src/%.clp qclsrc.srcpf
system -q "CPYFRMSTMF FROMSTMF('$<') TOMBR('/qsys.lib/$(LIBRARY).lib/qclsrc.file/$*.mbr') MBROPT(*REPLACE)"
system -q "CRTCLPGM PGM($(LIBRARY)/$*) SRCFILE($(LIBRARY)/QCLSRC) TGTRLS($(TGTRLS))"
touch $@
%.pgm: %.module
system -q "CRTPGM PGM($(LIBRARY)/$(@:%.pgm=%)) MODULE($(^:%.module=$(LIBRARY)/%)) TGTRLS($(TGTRLS))" && touch $@
%.srvpgm: %.module
system -q "CRTSRVPGM SRVPGM($(LIBRARY)/$(@:%.srvpgm=%)) MODULE($(^:%.module=$(LIBRARY)/%)) EXPORT(*ALL) ACTGRP(*CALLER) TGTRLS($(TGTRLS))" && touch $@
%.sqlinst: src/%.sql
system -q "RUNSQLSTM SRCSTMF('$<')" && touch $@
%.module: src/%.rpgle
system "CRTRPGMOD MODULE($(LIBRARY)/$*) SRCSTMF('$<') DBGVIEW($(DBGVIEW)) REPLACE(*YES) TGTCCSID(37) TGTRLS($(TGTRLS))" > $*.log 2> $*.msg && rm $*.log $*.msg || touch $*.failed
test ! -e $*.msg || cat $*.msg
test ! -e $*.log || ./parse.sh $*.log
if [ -e $*.failed ]; then rm $*.failed; exit 1; fi
touch $@
%.module: src/%.sqlrpgle
system "CRTSQLRPGI OBJ($(LIBRARY)/$*) SRCSTMF('$<') OBJTYPE(*MODULE) REPLACE(*YES) RPGPPOPT(*LVL2) COMPILEOPT('INCDIR(''src/'') TGTCCSID(37)') TGTRLS($(TGTRLS))" > $*.log 2> $*.msg && rm $*.log $*.msg || touch $*.failed
test ! -e $*.msg || cat $*.msg
test ! -e $*.log || ./parse.sh $*.log
if [ -e $*.failed ]; then rm $*.failed; exit 1; fi
touch $@
%.module: src/%.c
system "CRTCMOD MODULE($(LIBRARY)/$*) SRCSTMF('$<') DBGVIEW($(DBGVIEW)) REPLACE(*YES) TGTCCSID(37) TGTRLS($(TGTRLS))" > $*.log 2> $*.msg && rm $*.log $*.msg || touch $*.failed
test ! -e $*.msg || cat $*.msg
test ! -e $*.log || cat $*.log
if [ -e $*.failed ]; then rm $*.failed; exit 1; fi
touch $@
%.lib:
(system -q 'CHKOBJ $* *LIB' || system -q 'CRTLIB $*') && touch $@
%.srcpf: $(LIBRARY).lib
(system -q 'CHKOBJ $(LIBRARY)/$* *FILE' || system -q 'CRTSRCPF $(LIBRARY)/$*') && touch $@