Git init
[external/mawk.git] / msdos / makefile.msc
1 # Microsoft C makefile for mawk,
2 # an implementation of The AWK Programming Language, 1988.
3
4 # Tested with Microsoft C vers 6 and 7, using the following make utils:
5 #   dmake-3.8, GNUish make, Kneller's Ndmake, and Microsoft's nmake
6
7 #========================== Configuration ===============================
8 # Compiler flags:
9 #  -AL large model
10 #  -Gs remove stack probes, -G2 requires 286-or-better
11 #  -O,-Ot optimize for time, -Os optimize for size
12 # MSDOS and _MSC_VER are predefined.
13
14 CC = cl -nologo
15 CFLAGS = -AL -O $(DEFS)
16
17 MSCLIB=llibce
18
19 # Link and bind for DOS-only programs
20 STACK=0x4000
21 LF2=$(MSCLIB)
22
23 # Link and bind for bound OS/2 and DOS programs
24 STACK=0x4800
25 LF2=$(MSCLIB)p,mawk.def
26 BIND=bind $@
27 DEFS=-DOS2
28
29 #========================================================================
30
31
32 .c.obj:
33         $(CC) $(CFLAGS) -c $<
34
35 OBJ1 = parse.obj array.obj bi_funct.obj bi_vars.obj cast.obj code.obj \
36         da.obj error.obj execute.obj fcall.obj 
37
38 OBJ2 =  field.obj files.obj fin.obj hash.obj jmp.obj init.obj \
39         kw.obj main.obj matherr.obj
40
41 OBJ3 = memory.obj print.obj re_cmpl.obj scan.obj scancode.obj split.obj \
42         zmalloc.obj version.obj dosexec.obj
43
44 OBJ = $(OBJ1) $(OBJ2) $(OBJ3)
45
46 REXP_OBJ = rexp.obj rexp0.obj rexp1.obj rexp2.obj rexp3.obj rexpdb.obj
47
48 RSP = mawk.lnk
49
50 mawk.exe : $(OBJ) $(REXP_OBJ) $(RSP)
51         link @$(RSP) setargv.obj/NOE,$@,,/NOD:llibce $(LF2)/STACK:$(STACK);
52         $(BIND)
53
54 $(RSP) : $(OBJ) $(REXP_OBJ)
55         echo $(OBJ1)+ > $@
56         echo $(OBJ2)+ >> $@
57         echo $(OBJ3)+ >> $@
58         echo $(REXP_OBJ)+ >> $@
59
60 RFLAGS=-I. -Irexp -DMAWK
61
62 rexp.obj  :  rexp/rexp.c  rexp/rexp.h
63         $(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp.c
64
65 rexp0.obj  :  rexp/rexp0.c  rexp/rexp.h
66         $(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp0.c
67
68 rexp1.obj  :  rexp/rexp1.c  rexp/rexp.h
69         $(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp1.c
70
71 rexp2.obj  :  rexp/rexp2.c  rexp/rexp.h
72         $(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp2.c
73
74 rexp3.obj  :  rexp/rexp3.c  rexp/rexp.h
75         $(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexp3.c
76
77 rexpdb.obj  :  rexp/rexpdb.c  rexp/rexp.h
78         $(CC) $(CFLAGS) $(RFLAGS) -c rexp/rexpdb.c
79
80 config.h : msdos/msc.h
81         copy msdos\msc.h  config.h
82         copy msdos\mawk.def .
83
84 dosexec.c : msdos/dosexec.c
85         copy msdos\dosexec.c dosexec.c
86
87 test : mawk.exe  # test that we have a sane mawk
88         @echo you may have to run the test manually
89         cd test && mawktest.bat
90
91 fpe_test :  mawk.exe # test FPEs are handled OK
92         @echo testing floating point exception handling
93         @echo you may have to run the test manually
94         cd test && fpe_test.bat
95
96 ###################################################
97 # parse.c is provided 
98 # so you don't need to make it.
99 #
100 # But if you do:  here's how:
101 # To make it with bison under msdos
102 # YACC=bison -y
103 # parse.c : parse.y 
104 #       $(YACC) -d parse.y
105 #       rename y_tab.h parse.h
106 #       rename y_tab.c parse.c
107 ########################################
108
109 #scancode.c :  makescan.c  scan.h
110 #       $(CC) -o makescan.exe  makescan.c
111 #       makescan.exe > scancode.c
112 #       del makescan.exe
113
114 clean :
115         del *.obj
116
117 distclean :
118         del *.obj
119         del config.h dosexec.c
120         del mawk.exe
121
122
123 #  dependencies of .objs on .h
124 array.obj : config.h field.h bi_vars.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
125 bi_funct.obj : config.h field.h bi_vars.h mawk.h init.h regexp.h symtype.h nstd.h repl.h memory.h bi_funct.h files.h zmalloc.h fin.h types.h sizes.h
126 bi_vars.obj : config.h field.h bi_vars.h mawk.h init.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
127 cast.obj : config.h field.h mawk.h parse.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
128 code.obj : config.h field.h code.h mawk.h init.h symtype.h nstd.h memory.h jmp.h zmalloc.h types.h sizes.h
129 da.obj : config.h field.h code.h mawk.h symtype.h nstd.h memory.h repl.h bi_funct.h zmalloc.h types.h sizes.h
130 error.obj : config.h bi_vars.h mawk.h parse.h vargs.h symtype.h nstd.h scan.h types.h sizes.h
131 execute.obj : config.h field.h bi_vars.h code.h mawk.h regexp.h symtype.h nstd.h memory.h repl.h bi_funct.h zmalloc.h types.h fin.h sizes.h
132 fcall.obj : config.h code.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
133 field.obj : config.h field.h bi_vars.h mawk.h init.h parse.h regexp.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
134 files.obj : config.h mawk.h nstd.h memory.h files.h zmalloc.h types.h fin.h sizes.h
135 fin.obj : config.h field.h bi_vars.h mawk.h parse.h symtype.h nstd.h memory.h scan.h zmalloc.h types.h fin.h sizes.h
136 hash.obj : config.h mawk.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
137 init.obj : config.h field.h bi_vars.h code.h mawk.h init.h symtype.h nstd.h memory.h zmalloc.h types.h sizes.h
138 jmp.obj : config.h code.h mawk.h init.h symtype.h nstd.h memory.h jmp.h zmalloc.h types.h sizes.h
139 kw.obj : config.h mawk.h init.h parse.h symtype.h nstd.h types.h sizes.h
140 main.obj : config.h field.h bi_vars.h code.h mawk.h init.h symtype.h nstd.h memory.h files.h zmalloc.h types.h fin.h sizes.h
141 makescan.obj : parse.h symtype.h scan.h
142 matherr.obj : config.h mawk.h nstd.h types.h sizes.h
143 memory.obj : config.h mawk.h nstd.h memory.h zmalloc.h types.h sizes.h
144 parse.obj : config.h field.h bi_vars.h code.h mawk.h symtype.h nstd.h memory.h bi_funct.h files.h zmalloc.h jmp.h types.h sizes.h
145 print.obj : config.h field.h bi_vars.h mawk.h parse.h symtype.h nstd.h memory.h scan.h bi_funct.h files.h zmalloc.h types.h sizes.h
146 re_cmpl.obj : config.h mawk.h parse.h regexp.h symtype.h nstd.h memory.h repl.h scan.h zmalloc.h types.h sizes.h
147 scan.obj : config.h field.h code.h mawk.h init.h parse.h symtype.h nstd.h memory.h repl.h scan.h files.h zmalloc.h types.h fin.h sizes.h
148 split.obj : config.h field.h bi_vars.h mawk.h parse.h regexp.h symtype.h nstd.h memory.h scan.h bi_funct.h zmalloc.h types.h sizes.h
149 version.obj : config.h mawk.h patchlev.h nstd.h types.h sizes.h
150 zmalloc.obj : config.h mawk.h nstd.h zmalloc.h types.h sizes.h