forked from clibs/sha1
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
69 lines (51 loc) · 2.42 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#-------------------------------------------------------------------------------
# User-defined part start
#
# note: ILE RPG compilers don't support UTF-8, so we use win-1252; However ILE C supports UTF-8
# BIN_LIB is the destination library for the service program.
# The rpg modules and the binder source file are also created in BIN_LIB.
# Binder source file and rpg module can be remove with the clean step
# (make clean).
BIN_LIB=ILESHA1
LIBLIST=$(BIN_LIB)
# The shell we use
SHELL=/QOpenSys/usr/bin/qsh
#
# The folder where the copy books for ILEsha1 will be copied to with the
# install step (make install).
#
USRINCDIR='/usr/local/include'
#
# User-defined part end
#-------------------------------------------------------------------------------
# system and application include folder
INCLUDE='/QIBM/include' './.'
# CCFLAGS = C compiler parameter
CCFLAGS2=OPTION(*STDLOGMSG *SHOWINC ) OUTPUT(*NONE) OPTIMIZE(10) ENUM(*INT) TERASPACE(*YES) STGMDL(*INHERIT) SYSIFCOPT(*IFSIO) DBGVIEW(*ALL) INCDIR($(INCLUDE))
CCFLAGS1=OPTION(*STDLOGMSG) OUTPUT(*NONE) OPTIMIZE(10) ENUM(*INT) TERASPACE(*YES) STGMDL(*INHERIT) SYSIFCOPT(*IFSIO) DBGVIEW(*ALL) INCDIR($(INCLUDE))
all: env compile bind test
env:
-system -q "CRTLIB $(BIN_LIB) TYPE(*TEST) TEXT('ILEsha1: sha-1 implementation ')"
-system -q "CRTBNDDIR BNDDIR($(BIN_LIB)/ILEsha1)"
-system -q "ADDBNDDIRE BNDDIR($(BIN_LIB)/ILEsha1) OBJ((ILEsha1))"
system "CHGATR OBJ('./*') ATR(*CCSID) VALUE(1208)"
compile: .PHONY
system "CRTCMOD MODULE($(BIN_LIB)/sha1) SRCSTMF('sha1.c') $(CCFLAGS2) "
bind:
liblist -a $(LIBLIST);\
system -q "CRTSRCPF FILE($(BIN_LIB)/QSRVSRC) RCDLEN(112)";\
system "CPYFRMSTMF FROMSTMF('ILEsha1.bnd') TOMBR('/QSYS.lib/$(BIN_LIB).lib/QSRVSRC.file/ILEsha1.mbr') MBROPT(*replace)";\
system -q "DLTOBJ OBJ($(BIN_LIB)/ILEsha1) OBJTYPE(*SRVPGM)";\
system -kpieb "CRTSRVPGM SRVPGM($(BIN_LIB)/ILEsha1) MODULE($(BIN_LIB)/sha1) OPTION(*DUPPROC) DETAIL(*BASIC) STGMDL(*INHERIT) SRCFILE($(BIN_LIB)/QSRVSRC) TEXT('ILEsha1 - sha 1 implementation')";
clean:
-system -q "CLRLIB $(BIN_LIB)"
test: .PHONY
system "CRTCMOD MODULE($(BIN_LIB)/test) SRCSTMF('test.c') $(CCFLAGS2) "
system "CRTPGM PGM($(BIN_LIB)/test) BNDSRVPGM($(BIN_LIB)/ILEsha1)"
# For vsCode
current: env
system "CRTCMOD MODULE($(BIN_LIB)/$(SRC)) SRCSTMF('src/$(SRC).c') $(CCFLAGS2) "
install:
-mkdir $(USRINCDIR)/ILEsha1
cp headers/ILEsha1.rpgle $(USRINCDIR)/ILEsha1/
.PHONY: