2019-01-14 11:18:57 +01:00
|
|
|
GCC=gcc -O0 -g -nostdinc -ffreestanding -fno-builtin -Wall -w -I ../../include -march=i386 -m16 -fomit-frame-pointer -fno-pie -no-pie -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 -c
|
|
|
|
ASM=gcc -m16 -march=i386 -fomit-frame-pointer -fno-pie -no-pie -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 -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))
|
2018-12-30 12:25:20 +01:00
|
|
|
|
|
|
|
all: setup.bin
|
|
|
|
sync
|
|
|
|
|
2019-01-02 13:59:16 +01:00
|
|
|
setup: setupc.o setup.o
|
2018-12-30 12:25:20 +01:00
|
|
|
$(LINK) -T setup.ld setupc.o setup.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) $@ $^
|
|
|
|
|
|
|
|
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~
|
|
|
|
sync
|
|
|
|
|
|
|
|
indent:
|
|
|
|
$(CHANGEPERM) *.c
|
|
|
|
$(CONVERT) *.c
|
|
|
|
$(INDENT) *.c
|
|
|
|
$(REMOVE) *.c~
|
|
|
|
sync
|