2019-01-15 01:15:58 +01:00
|
|
|
GCC=gcc -O0 -g -nostdinc -ffreestanding -Wall -Wstrict-prototypes -fno-stack-protector -march=i386 -m16 -fno-pic -fno-strict-aliasing -mno-mmx -mno-sse -w -I ../../include -c
|
2019-01-14 14:54:50 +01:00
|
|
|
ASM=gcc -O0 -m16 -march=i386 -fno-pic -D__ASSEMBLY__ -I ../ -I ../../include -c -o
|
2019-01-01 13:30:06 +01:00
|
|
|
LINK=ld -m elf_i386 -n
|
2018-12-30 12:25:20 +01:00
|
|
|
CONVERT=dos2unix
|
|
|
|
INDENT=indent -nhnl -l75 -ppi3 -ts8 -bls -nbc -di8 -nbad -nbap -nsob -i8 -bl -bli0 -ncdw -nce -cli8 -cbi0 -npcs -cs -saf -sai -saw -nprs -lp -npsl
|
|
|
|
REMOVE=rm -f
|
|
|
|
CHANGEPERM=chmod 644
|
2019-01-02 13:59:16 +01:00
|
|
|
NM=nm
|
|
|
|
OBJCOPY=objcopy -O binary -R .note -R .comment -S
|
|
|
|
OBJDEBUG=objcopy --only-keep-debug
|
2019-01-02 15:47:56 +01:00
|
|
|
$(eval VERSION=$(shell git describe --tags))
|
2020-09-17 09:52:56 +02:00
|
|
|
SYNC=sync
|
2018-12-30 12:25:20 +01:00
|
|
|
|
|
|
|
all: setup.bin
|
2020-09-17 09:52:56 +02:00
|
|
|
$(SYNC)
|
2018-12-30 12:25:20 +01:00
|
|
|
|
2019-01-15 01:15:58 +01:00
|
|
|
setup: setupc.o setup.o setup32.o
|
|
|
|
$(LINK) -T setup.ld setupc.o setup.o setup32.o
|
2019-01-02 13:59:16 +01:00
|
|
|
|
|
|
|
setup.bin: setup
|
|
|
|
$(OBJCOPY) $^ $@
|
|
|
|
$(OBJDEBUG) setup setup.sym
|
|
|
|
$(NM) setup > setup.map
|
2018-12-30 12:25:20 +01:00
|
|
|
|
|
|
|
setupc.o: setup.c
|
2019-01-02 15:47:56 +01:00
|
|
|
$(GCC) -DVERSION=$(VERSION) -o $@ $^
|
2018-12-30 12:25:20 +01:00
|
|
|
|
|
|
|
setup.o: setup.S
|
|
|
|
$(ASM) $@ $^
|
|
|
|
|
2019-01-15 01:15:58 +01:00
|
|
|
setup32.o: pmode.S
|
|
|
|
$(ASM) $@ $^
|
|
|
|
|
2018-12-30 12:25:20 +01:00
|
|
|
clean:
|
2019-01-02 13:59:16 +01:00
|
|
|
$(REMOVE) setup
|
2018-12-30 12:25:20 +01:00
|
|
|
$(REMOVE) *.o
|
2019-01-02 13:59:16 +01:00
|
|
|
$(REMOVE) *.sym
|
|
|
|
$(REMOVE) *.map
|
2018-12-30 12:25:20 +01:00
|
|
|
$(REMOVE) *.out
|
|
|
|
$(REMOVE) *.bin
|
|
|
|
$(REMOVE) *.sys
|
|
|
|
$(REMOVE) *.s
|
|
|
|
$(REMOVE) *.c~
|
2020-09-17 09:52:56 +02:00
|
|
|
$(SYNC)
|
2018-12-30 12:25:20 +01:00
|
|
|
|
|
|
|
indent:
|
|
|
|
$(CHANGEPERM) *.c
|
|
|
|
$(CONVERT) *.c
|
|
|
|
$(INDENT) *.c
|
|
|
|
$(REMOVE) *.c~
|
2020-09-17 09:52:56 +02:00
|
|
|
$(SYNC)
|
|
|
|
|