📄 makefile
字号:
# need this for DJGPP MAKE, omit for Borland MAKE
# be sure the MAKE you want is first on the command search path
.SUFFIXES: .asm .bin .com
# Borland MAKE 2.0 has no "-f" option; uses only makefiles named 'makefile'
MAKEDEP=makefile
CFLAGS =-v -mt -w -O2 -d -Z -1
# change LIBPATH depending on what version of Turbo/Borland C you use
LIBPATH =c:\t\lib
LFLAGS =/x/c
# targets
all: stage1\fat12-f.bin stage1\fat16-hd.bin stage2\loader.bin
install: stage1\fat12-f.bin stage2\loader.bin
partcopy stage1\fat12-f.bin 0 3 -f0
partcopy stage1\fat12-f.bin 24 1DC -f0 24
copy /y stage2\loader.bin a:
clean:
# Borland MAKE 2.0 needs "command /c"
command /c for %f in (stage1\*.bin stage1\*.lst stage2\*.o stage2\*.bin) do del %f
# dependencies
stage1\fat12-f.bin: stage1\fat12-f.asm $(MAKEDEP)
stage1\fat16-hd.bin: stage1\fat16-hd.asm $(MAKEDEP)
stage2\boot.o: stage2\boot.c $(MAKEDEP)
# implicit rules
.asm.bin:
nasm -f bin -o $*.bin $*.asm
# Borland MAKE 2.0 does not support redirection
# ndisasm -o 0x7C00 $*.bin >$*.lst
.c.o:
# Borland MAKE 2.0 does not understand $@ macro
# tcc $(CFLAGS) -c -o$@ $<
tcc $(CFLAGS) -c -o$*.o $<
# explicit rules
stage2\loader.bin: stage2\start.asm stage2\boot.o $(MAKEDEP)
nasm -f obj -o stage2\start.o stage2\start.asm
# TLINK 2.0 doesn't understand "/L" option, so give full path to libc
tlink $(LFLAGS)/t stage2\start.o stage2\boot.o,stage2\loader.bin,,$(LIBPATH)\cs.lib
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -