2017-12-19 13:29:43 +01:00
|
|
|
#
|
|
|
|
# GCC.MAK - kernel compiler options for ia16-elf-gcc
|
|
|
|
#
|
|
|
|
|
|
|
|
CC=ia16-elf-gcc -c
|
2017-12-19 16:40:39 +01:00
|
|
|
CL=ia16-elf-gcc
|
2017-12-19 13:29:43 +01:00
|
|
|
INCLUDEPATH=.
|
|
|
|
|
|
|
|
!if $(XCPU) != 186
|
|
|
|
!if $(XCPU) != 386
|
|
|
|
TARGETOPT=-march=i8086
|
|
|
|
!endif
|
|
|
|
!endif
|
|
|
|
|
2017-12-21 18:40:34 +01:00
|
|
|
LIBUTIL=ar crs
|
2017-12-19 13:29:43 +01:00
|
|
|
LIBPLUS=
|
|
|
|
LIBTERM=
|
|
|
|
|
|
|
|
TINY=-mcmodel=tiny
|
2017-12-21 18:35:47 +01:00
|
|
|
CFLAGST=-Os -fpack-struct -fcall-used-es -w -o $@
|
2017-12-19 13:29:43 +01:00
|
|
|
CFLAGSC=
|
|
|
|
|
|
|
|
TARGET=KGC
|
|
|
|
|
|
|
|
#
|
|
|
|
# heavy stuff - building
|
|
|
|
#
|
|
|
|
# -mcmodel=small small memory model (small code/small data)
|
2017-12-19 16:40:39 +01:00
|
|
|
# -Os -> favor code size over execution time in optimizations
|
2017-12-19 13:29:43 +01:00
|
|
|
# -fleading-underscore underscores leading field for DOS compiler compat
|
|
|
|
# -fno-common no "common" variables, just BSS for uninitialized data
|
|
|
|
# -fpack-struct pack structure members
|
|
|
|
# -ffreestanding don't assume any headers
|
|
|
|
# -fcall-used-es es clobbered in function calls
|
|
|
|
# -mrtd use stdcall calling convention
|
|
|
|
# -w disable warnings for now
|
|
|
|
# -Werror treat all warnings as errors
|
|
|
|
|
2017-12-19 16:40:39 +01:00
|
|
|
ALLCFLAGS=-I../hdr $(TARGETOPT) $(ALLCFLAGS) -mcmodel=small -fleading-underscore -fno-common -fpack-struct -ffreestanding -fcall-used-es -mrtd -w -Werror -Os
|
2017-12-19 13:29:43 +01:00
|
|
|
INITCFLAGS=$(ALLCFLAGS) -o $@
|
|
|
|
CFLAGS=$(ALLCFLAGS) -o $@
|
2017-12-19 14:22:58 +01:00
|
|
|
NASMFLAGS=$(NASMFLAGS) -f elf -o $@
|
2017-12-19 13:29:43 +01:00
|
|
|
|
|
|
|
DIRSEP=/
|
|
|
|
RM=rm -f
|
2017-12-19 16:40:39 +01:00
|
|
|
CP=cp
|
2017-12-19 13:29:43 +01:00
|
|
|
ECHOTO=echo>>
|
2017-12-19 19:46:49 +01:00
|
|
|
INITPATCH=objcopy --redefine-sym ___umodsi3=_init_umodsi3 --redefine-sym ___udivsi3=_init_udivsi3 --redefine-sym ___ashlsi3=_init_ashlsi3 --redefine-sym ___lshrsi3=_init_lshrsi3
|
2017-12-19 13:29:43 +01:00
|
|
|
CLDEF=1
|
|
|
|
CLT=gcc -DDOSC_TIME_H -I../hdr -o $@
|
|
|
|
CLC=$(CLT)
|
2017-12-19 16:40:39 +01:00
|
|
|
XLINK=$(CL) -Tkernel.ld -Wl,-Map,kernel.map -o kernel.exe $(OBJS) -Wl,--whole-archive ../drivers/device.lib -Wl,--no-whole-archive $#
|