2001-11-04 21:10:15 +01:00
|
|
|
#
|
|
|
|
# Makefile for Borland C++ 3.1 for kernel.sys
|
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
2003-06-30 20:39:44 +02:00
|
|
|
!include "../mkfiles/generic.mak"
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
LIBS=..\lib\device.lib ..\lib\libm.lib
|
2001-11-04 21:10:15 +01:00
|
|
|
HDR=../hdr/
|
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
# *List Macros*
|
|
|
|
# Only 8 files per definition; this is limitation of DOS batch
|
|
|
|
# files (only 9 directly accessible parameters).
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2003-09-15 12:46:24 +02:00
|
|
|
OBJS1=kernel.obj entry.obj io.obj console.obj serial.obj printer.obj dsk.obj \
|
|
|
|
sysclk.obj
|
|
|
|
OBJS2=asmsupt.obj execrh.obj nlssupt.obj procsupt.obj dosidle.obj int2f.obj \
|
|
|
|
nls_hc.obj
|
2004-04-11 14:21:25 +02:00
|
|
|
OBJS3=apisupt.obj intr.obj irqstack.obj blockio.obj chario.obj systime.obj \
|
2003-09-15 12:46:24 +02:00
|
|
|
error.obj
|
|
|
|
OBJS4=break.obj dosfns.obj fatdir.obj fatfs.obj fattab.obj fcbfns.obj \
|
|
|
|
inthndlr.obj
|
|
|
|
OBJS5=ioctl.obj dosnames.obj memmgr.obj task.obj newstuff.obj nls.obj network.obj
|
2004-02-24 01:25:56 +01:00
|
|
|
OBJS6=prf.obj misc.obj strings.obj syspack.obj lfnapi.obj iasmsupt.obj
|
2003-09-15 12:46:24 +02:00
|
|
|
OBJS7=main.obj config.obj initoem.obj inithma.obj dyninit.obj iprf.obj \
|
|
|
|
initdisk.obj initclk.obj
|
2004-04-11 14:21:25 +02:00
|
|
|
OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5) $(OBJS6) $(OBJS7)
|
2001-11-04 21:10:15 +01:00
|
|
|
|
|
|
|
# *Explicit Rules*
|
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
production: ..\bin\$(TARGET).sys
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
..\bin\$(TARGET).sys: kernel.sys
|
2001-11-04 21:10:15 +01:00
|
|
|
copy kernel.sys ..\bin
|
2004-04-11 14:21:25 +02:00
|
|
|
copy kernel.sys ..\bin\$(TARGET).sys
|
|
|
|
copy kernel.map ..\bin\$(TARGET).map
|
2001-11-04 21:10:15 +01:00
|
|
|
|
|
|
|
kernel.sys: kernel.exe ..\utils\exeflat.exe
|
2007-05-15 19:48:47 +02:00
|
|
|
dir kernel.exe
|
2002-01-23 23:29:41 +01:00
|
|
|
$(XUPX) kernel.exe
|
|
|
|
..\utils\exeflat kernel.exe kernel.sys 0x60 -S0x10 -S0x8B $(UPXOPT)
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
kernel.exe: $(TARGET).lnk $(OBJS) $(LIBS)
|
|
|
|
$(LINK) @$(TARGET).lnk;
|
|
|
|
|
2001-11-04 21:10:15 +01:00
|
|
|
clobber: clean
|
2001-11-14 00:36:45 +01:00
|
|
|
-$(RM) kernel.exe kernel.sys status.me
|
2001-11-04 21:10:15 +01:00
|
|
|
|
|
|
|
clean:
|
2004-04-11 14:21:25 +02:00
|
|
|
-$(RM) *.obj *.bak *.crf *.xrf *.map *.lst *.cod *.err *.lnk
|
2001-11-04 21:10:15 +01:00
|
|
|
|
|
|
|
# XXX: This is a very ugly way of linking the kernel, forced upon us by the
|
|
|
|
# inability of Turbo `make' 2.0 to perform command line redirection. -- ror4
|
2002-10-22 04:40:19 +02:00
|
|
|
|
2003-09-15 12:46:24 +02:00
|
|
|
ECHOTO=..\utils\echoto
|
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
$(TARGET).lnk: turboc.cfg makefile ..\mkfiles\generic.mak ..\mkfiles\$(COMPILER).mak
|
|
|
|
-$(RM) *.lnk
|
|
|
|
$(ECHOTO) $(TARGET).lnk $(OBJS1)+
|
|
|
|
$(ECHOTO) $(TARGET).lnk $(OBJS2)+
|
|
|
|
$(ECHOTO) $(TARGET).lnk $(OBJS3)+
|
|
|
|
$(ECHOTO) $(TARGET).lnk $(OBJS4)+
|
|
|
|
$(ECHOTO) $(TARGET).lnk $(OBJS5)+
|
|
|
|
$(ECHOTO) $(TARGET).lnk $(OBJS6)+
|
|
|
|
$(ECHOTO) $(TARGET).lnk $(OBJS7)
|
|
|
|
$(ECHOTO) $(TARGET).lnk kernel.exe
|
|
|
|
$(ECHOTO) $(TARGET).lnk kernel.map
|
|
|
|
$(ECHOTO) $(TARGET).lnk $(LIBS)
|
2001-11-04 21:10:15 +01:00
|
|
|
|
|
|
|
# *Individual File Dependencies*
|
2004-04-11 14:21:25 +02:00
|
|
|
apisupt.obj: apisupt.asm segs.inc $(TARGET).lnk
|
|
|
|
asmsupt.obj: asmsupt.asm segs.inc $(TARGET).lnk
|
|
|
|
console.obj: console.asm io.inc $(TARGET).lnk
|
|
|
|
dosidle.obj: dosidle.asm segs.inc $(TARGET).lnk
|
2004-04-12 11:36:07 +02:00
|
|
|
entry.obj: entry.asm segs.inc $(HDR)stacks.inc $(TARGET).lnk
|
2004-04-11 14:21:25 +02:00
|
|
|
execrh.obj: execrh.asm segs.inc $(TARGET).lnk
|
2004-04-12 11:36:07 +02:00
|
|
|
int2f.obj: int2f.asm segs.inc $(HDR)stacks.inc $(TARGET).lnk
|
2004-04-11 14:21:25 +02:00
|
|
|
intr.obj: intr.asm segs.inc $(TARGET).lnk
|
2004-05-30 22:59:33 +02:00
|
|
|
io.obj: io.asm segs.inc $(HDR)stacks.inc $(TARGET).lnk
|
2004-04-11 14:21:25 +02:00
|
|
|
irqstack.obj: irqstack.asm segs.inc $(TARGET).lnk
|
|
|
|
kernel.obj: kernel.asm segs.inc ludivmul.inc $(TARGET).lnk
|
|
|
|
nls_hc.obj: nls_hc.asm segs.inc $(TARGET).lnk
|
2004-05-30 22:59:33 +02:00
|
|
|
nlssupt.obj: nlssupt.asm segs.inc $(HDR)stacks.inc $(TARGET).lnk
|
2004-04-11 14:21:25 +02:00
|
|
|
printer.obj: printer.asm io.inc $(TARGET).lnk
|
|
|
|
procsupt.obj: procsupt.asm segs.inc $(HDR)stacks.inc $(TARGET).lnk
|
|
|
|
serial.obj: serial.asm io.inc $(TARGET).lnk
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
HDRS=\
|
2001-11-04 21:10:15 +01:00
|
|
|
$(HDR)portab.h $(HDR)device.h $(HDR)mcb.h $(HDR)pcb.h \
|
|
|
|
$(HDR)fat.h $(HDR)fcb.h $(HDR)tail.h $(HDR)time.h $(HDR)process.h \
|
|
|
|
$(HDR)dcb.h $(HDR)sft.h $(HDR)cds.h $(HDR)exe.h $(HDR)fnode.h \
|
|
|
|
$(HDR)dirmatch.h $(HDR)file.h $(HDR)clock.h $(HDR)kbd.h $(HDR)error.h \
|
2004-04-11 14:21:25 +02:00
|
|
|
$(HDR)version.h dyndata.h
|
|
|
|
HEADERS=$(HDRS) globals.h proto.h
|
|
|
|
INITHEADERS=$(HDRS) init-mod.h init-dat.h
|
|
|
|
|
|
|
|
blockio.obj: blockio.c $(HEADERS) $(TARGET).lnk
|
|
|
|
break.obj: break.c $(HEADERS) $(TARGET).lnk
|
|
|
|
chario.obj: chario.c $(HEADERS) $(TARGET).lnk
|
|
|
|
dosfns.obj: dosfns.c $(HEADERS) $(TARGET).lnk
|
|
|
|
dosnames.obj: dosnames.c $(HEADERS) $(TARGET).lnk
|
|
|
|
dsk.obj: dsk.c $(HEADERS) $(TARGET).lnk
|
|
|
|
error.obj: error.c $(HEADERS) $(TARGET).lnk
|
|
|
|
fatdir.obj: fatdir.c $(HEADERS) $(TARGET).lnk
|
|
|
|
fatfs.obj: fatfs.c $(HEADERS) $(TARGET).lnk
|
|
|
|
fattab.obj: fattab.c $(HEADERS) $(TARGET).lnk
|
|
|
|
fcbfns.obj: fcbfns.c $(HEADERS) $(TARGET).lnk
|
|
|
|
inthndlr.obj: inthndlr.c $(HEADERS) $(TARGET).lnk
|
|
|
|
ioctl.obj: ioctl.c $(HEADERS) $(TARGET).lnk
|
|
|
|
memmgr.obj: memmgr.c $(HEADERS) $(TARGET).lnk
|
|
|
|
misc.obj: misc.c $(HEADERS) $(TARGET).lnk
|
|
|
|
lfnapi.obj: lfnapi.c $(HEADERS) $(TARGET).lnk
|
|
|
|
newstuff.obj: newstuff.c $(HEADERS) $(TARGET).lnk
|
|
|
|
network.obj: network.c $(HEADERS) $(TARGET).lnk
|
|
|
|
nls.obj: nls.c $(HEADERS) $(TARGET).lnk
|
|
|
|
prf.obj: prf.c $(HDR)portab.h $(TARGET).lnk
|
|
|
|
strings.obj: strings.c $(TARGET).lnk
|
|
|
|
sysclk.obj: sysclk.c $(HEADERS) $(TARGET).lnk
|
|
|
|
syspack.obj: syspack.c $(HEADERS) $(TARGET).lnk
|
|
|
|
systime.obj: systime.c $(HEADERS) $(TARGET).lnk
|
|
|
|
task.obj: task.c $(HEADERS) $(TARGET).lnk
|
2001-11-04 21:10:15 +01:00
|
|
|
|
|
|
|
# now the funny stuff :-)
|
|
|
|
# Files in the INIT segment
|
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
# XXX: Special handling for initialization modules -- this is required because
|
|
|
|
# TC 2.01 cannot handle `#pragma option' like TC 3 can. -- ror4
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
config.obj: config.c $(INITHEADERS) $(TARGET).lnk
|
2002-08-02 23:55:14 +02:00
|
|
|
$(CC) $(INITCFLAGS) $*.c
|
2002-01-23 23:29:41 +01:00
|
|
|
$(INITPATCH) $*.obj
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
initoem.obj: initoem.c $(INITHEADERS) $(TARGET).lnk
|
2002-08-02 23:55:14 +02:00
|
|
|
$(CC) $(INITCFLAGS) $*.c
|
2002-01-23 23:29:41 +01:00
|
|
|
$(INITPATCH) $*.obj
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
main.obj: main.c $(INITHEADERS) $(TARGET).lnk
|
2002-08-02 23:55:14 +02:00
|
|
|
$(CC) $(INITCFLAGS) $*.c
|
2002-01-23 23:29:41 +01:00
|
|
|
$(INITPATCH) $*.obj
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
inithma.obj: inithma.c $(INITHEADERS) $(TARGET).lnk
|
2002-08-02 23:55:14 +02:00
|
|
|
$(CC) $(INITCFLAGS) $*.c
|
2002-01-23 23:29:41 +01:00
|
|
|
$(INITPATCH) $*.obj
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
dyninit.obj: dyninit.c $(INITHEADERS) $(TARGET).lnk
|
2002-08-02 23:55:14 +02:00
|
|
|
$(CC) $(INITCFLAGS) $*.c
|
2002-01-23 23:29:41 +01:00
|
|
|
$(INITPATCH) $*.obj
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
initdisk.obj: initdisk.c $(INITHEADERS) $(TARGET).lnk
|
2002-08-02 23:55:14 +02:00
|
|
|
$(CC) $(INITCFLAGS) $*.c
|
2002-01-23 23:29:41 +01:00
|
|
|
$(INITPATCH) $*.obj
|
2001-11-04 21:10:15 +01:00
|
|
|
|
2004-04-11 14:21:25 +02:00
|
|
|
initclk.obj: initclk.c $(INITHEADERS) $(TARGET).lnk
|
2002-12-09 01:17:15 +01:00
|
|
|
$(CC) $(INITCFLAGS) $*.c
|
|
|
|
$(INITPATCH) $*.obj
|
|
|
|
|
2004-02-24 01:25:56 +01:00
|
|
|
#the string functions for INIT_TEXT
|
2004-04-11 14:21:25 +02:00
|
|
|
iasmsupt.obj: asmsupt.asm $(TARGET).lnk
|
2004-02-24 01:25:56 +01:00
|
|
|
$(NASM) -D$(COMPILER) -D_INIT $(NASMFLAGS) -f obj -o iasmsupt.obj asmsupt.asm
|
|
|
|
|
2001-11-14 00:36:45 +01:00
|
|
|
#the printf for INIT_TEXT - yet another special case, this file includes prf.c
|
2004-04-11 14:21:25 +02:00
|
|
|
iprf.obj: iprf.c prf.c $(HDR)portab.h $(TARGET).lnk
|
2002-08-02 23:55:14 +02:00
|
|
|
$(CC) $(INITCFLAGS) $*.c
|
2002-01-23 23:29:41 +01:00
|
|
|
$(INITPATCH) $*.obj
|