forked from FDOS/freecom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
195 lines (174 loc) · 6.98 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# $Id$
#
# Makefile for the FreeDOS kernel's command interpreter
#
# $Log$
# Revision 1.11 2003/08/03 16:00:57 skaus
# bugfix: /F (AutoFail) for the XMS_Swap variant
#
# Revision 1.10 2002/05/11 22:50:32 skaus
# v0.83 Beta 40:
# bugfix: ^Break detection after XMS-Swapping
#
# Revision 1.9 2002/05/11 22:10:40 skaus
# v0.83 Beta 40:
# bugfix: ^Break detection after XMS-Swapping
#
# Revision 1.8 2002/05/11 20:10:59 skaus
# bugfix: ^Break detection after XMS-Swapping
#
# Revision 1.7 2002/04/23 16:34:51 skaus
# chg: BUILD.BAT to handle XMS-Swap better
#
# Revision 1.6 2002/04/03 01:10:31 skaus
# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)
#
# Revision 1.5 2002/04/02 23:36:37 skaus
# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)
#
# Revision 1.4 2002/04/02 20:58:13 skaus
# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)
#
# Revision 1.3 2002/04/02 18:09:31 skaus
# add: XMS-Only Swap feature (FEATURE_XMS_SWAP) (Tom Ehlert)
#
# Revision 1.2 2001/06/10 17:17:24 skaus
# bugfix: Single point of configuration CONFIG.MAK/.H
#
# Revision 1.1 2001/04/12 00:09:06 skaus
# chg: New structure
# chg: If DEBUG enabled, no available commands are displayed on startup
# fix: PTCHSIZE also patches min extra size to force to have this amount
# of memory available on start
# bugfix: CALL doesn't reset options
# add: PTCHSIZE to patch heap size
# add: VSPAWN, /SWAP switch, .SWP resource handling
# bugfix: COMMAND.COM A:\
# bugfix: CALL: if swapOnExec == ERROR, no change of swapOnExec allowed
# add: command MEMORY
# bugfix: runExtension(): destroys command[-2]
# add: clean.bat
# add: localized CRITER strings
# chg: use LNG files for hard-coded strings (hangForEver(), init.c)
# via STRINGS.LIB
# add: DEL.C, COPY.C, CBREAK.C: STRINGS-based prompts
# add: fixstrs.c: prompts & symbolic keys
# add: fixstrs.c: backslash escape sequences
# add: version IDs to DEFAULT.LNG and validation to FIXSTRS.C
# chg: splitted code apart into LIB\*.c and CMD\*.c
# bugfix: IF is now using error system & STRINGS to report errors
# add: CALL: /N
#
#
.INCLUDE : ../_config.mk
# Sources of this make target
SRC = batch.c cmdtable.c command.c dummies.asm expalias.c init.c kswap.c \
loadhigh.c module.c redir.c ver.c
OBJ = batch.obj cmdtable.obj command.obj dummies.obj expalias.obj init.obj \
kswap.obj loadhigh.obj module.obj redir.obj ver.obj
HDR = ..\config.h ..\include/batch.h ..\include/cmdline.h \
..\include/command.h ..\include/context.h ..\include/crossjmp.h \
..\include/cswap.h ..\include/datefunc.h ..\include/debug.h \
..\include/keys.h ..\include/kswap.h ..\include/misc.h \
..\include/module.h ..\include/mux_ae.h ..\include/nls.h \
..\include/openf.h ..\include/res.h ..\include/resource.h \
..\include/timefunc.h ..\include\large.inc ..\include\model.inc \
..\include\small.inc
XMS_SWAP_PRE_OBJ = cb_catch.obj xms_crit.obj xms_brk.obj cswap.obj
XMS_SWAP_ADD_OBJ = cswapc.obj
.IF $(XMS_SWAP) == $(NULL)
SRC += cb_catch.asm
OBJ += cb_catch.obj
.ELSE
SRC += cswap.asm cswapc.c xms_crit.asm xms_brk.asm cb_catch.asm
HDR += ../include/cswapc.h
OBJ += $(XMS_SWAP_ADD_OBJ)
PRE_OBJ = $(XMS_SWAP_PRE_OBJ)
.ENDIF
# Default target
all: com.exe
dist : command.mak xms-swap.mak
%.obj : %.asm ; $(NASM) $(NASMFLAGS) -f obj -F borland -o $@ $< >>errlist
### Utils are required by build process
.INIT .PHONY .SEQUENTIAL : verscheck $(CFG) __errl
.IF $(THISMAKE) == $(LASTMAKE)
verscheck :;
.ELSE
verscheck :
@+-echo Changed Make parameters, already made files invalid!
+-echo LASTMAKE = $(THISMAKE) >lastmake.mk
$(RUNMAKE) clobber
.IF $(CFG)
$(RUNMAKE) $(CFG)
.ENDIF
.ENDIF
__errl:
@+-if exist errlist del errlist >nul
-ctags *.c ..\lib\*.c ..\cmd\*.c \freedos\src\lib\suppl\*.c
com.exe ?= _OBJS := $(PRE_OBJ) $(OBJ:s/c0.obj//)
# STD_OBJ !:= C0.OBJ
com.exe com.map .UPDATEALL : $(PRE_OBJ) $(OBJ) ../cmd/cmds.lib ../lib/freecom.lib
$(MAK_EXE)
#MAKEDEP START
expalias.obj : expalias.c \
../config.h ../err_fcts.h ../include/cmdline.h ../include/context.h \
../include/datefunc.h ../include/debug.h ../include/misc.h \
../include/timefunc.h
command.obj : command.c \
../config.h ../context.h_c ../err_fcts.h ../include/batch.h \
../include/cmdline.h ../include/command.h ../include/crossjmp.h \
../include/cswap.h ../include/datefunc.h ../include/debug.h \
../include/kswap.h ../include/misc.h ../include/mux_ae.h \
../include/nls.h ../include/openf.h ../include/timefunc.h ../strings.h
module.obj : module.c \
../config.h ../context.h_c ../include/command.h ../include/datefunc.h \
../include/debug.h ../include/kswap.h ../include/misc.h \
../include/module.h ../include/res.h ../include/resource.h \
../include/timefunc.h
kswap.obj : kswap.c \
../config.h ../context.h_c ../err_fcts.h ../include/command.h \
../include/context.h ../include/datefunc.h ../include/debug.h \
../include/kswap.h ../include/misc.h ../include/timefunc.h
ver.obj : ver.c \
../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \
../include/datefunc.h ../include/debug.h ../include/misc.h \
../include/timefunc.h ../strings.h
init.obj : init.c \
../config.h ../context.h_c ../err_fcts.h ../include/cmdline.h \
../include/command.h ../include/context.h ../include/cswap.h \
../include/datefunc.h ../include/debug.h ../include/keys.h \
../include/kswap.h ../include/misc.h ../include/module.h \
../include/timefunc.h ../strings.h
cmdtable.obj : cmdtable.c \
../config.h ../include/command.h ../include/datefunc.h \
../include/debug.h ../include/misc.h ../include/timefunc.h ../strings.h
loadhigh.obj : loadhigh.c \
../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \
../include/datefunc.h ../include/debug.h ../include/misc.h \
../include/timefunc.h ../strings.h
batch.obj : batch.c \
../config.h ../err_fcts.h ../include/batch.h ../include/cmdline.h \
../include/command.h ../include/datefunc.h ../include/debug.h \
../include/misc.h ../include/timefunc.h \
/freedos/src/include/../include/dfn.h
dummies.obj : dummies.asm \
.\..\include\large.inc .\..\include\model.inc .\..\include\small.inc
redir.obj : redir.c \
../config.h ../err_fcts.h ../include/cmdline.h ../include/command.h \
../include/datefunc.h ../include/debug.h ../include/misc.h \
../include/timefunc.h
DYNSOURCES =
#MAKEDEP STOP
cswapc.c : ../include/cswap.h ../include/misc.h
xms_crit.asm : ../criter/criter.asm
clobber : clean
$(RM) $(RMFLAGS) *.com *.cln command.mak com.exe *.cfg
clean :
$(RM) $(RMFLAGS) *.lst *.map *.bin *.bak *.las *.obj *.exe $(CFG) *.dmp com.com tags errlist
.IF $(XMS_SWAP) == $(NULL)
command.mak : makefile command.m1 command.m2
+copy command.m1 + $(mktmp command.exe : \44(CFG) $(OBJ:t" \\\\\\n\\t") \n\t\44(LD) /m/s/l /c /d @&&|\n\44(LIBPATH)\\c0s.obj+\n$(OBJ:t"+\\n")\n) + command.m2 $@
ALL_OBJ = $(XMS_SWAP_ADD_OBJ) $(OBJ:s/cb_catch.obj//)
xms-swap.mak : makefile command.m1 command.m2
+copy command.m1 + $(mktmp command.exe : \44(CFG) $(ALL_OBJ:t" \\\\\\n\\t") $(XMS_SWAP_PRE_OBJ)\n\t\44(LD) /m/s/l /c /d @&&|\n\44(LIBPATH)\\c0s.obj+\n$(XMS_SWAP_PRE_OBJ)+\n$(ALL_OBJ:t"+\\n")\n) + command.m2 $@
.ENDIF