2021-10-24 11:23:44 -04:00
|
|
|
TARGET = payload
|
2024-12-14 17:32:07 -05:00
|
|
|
OBJS = start.o stubs.o payload.o resolve.o kernel.o
|
2021-10-24 11:23:44 -04:00
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
OBJCOPY = objcopy
|
2024-12-14 17:32:07 -05:00
|
|
|
CFLAGS = -isystem sdk/include -Wl,--build-id=none -Os -Wno-builtin-declaration-mismatch -fno-stack-protector -fcf-protection=none -fpic -fpie
|
2024-12-06 07:57:11 -05:00
|
|
|
LDFLAGS = -T linker.ld -nostartfiles -nostdlib
|
2021-10-24 11:23:44 -04:00
|
|
|
|
|
|
|
all: $(TARGET).bin
|
|
|
|
|
|
|
|
%.bin: %.elf
|
2021-10-25 04:47:37 -04:00
|
|
|
$(OBJCOPY) -S -O binary $^ $@
|
2021-10-24 11:23:44 -04:00
|
|
|
|
|
|
|
$(TARGET).elf: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -f $(TARGET).bin $(TARGET).elf $(OBJS)
|