bd-jb/payload/Makefile

20 lines
373 B
Makefile
Raw Normal View History

2021-10-24 11:23:44 -04:00
TARGET = payload
OBJS = start.o payload.o
CC = gcc
AS = as
OBJCOPY = objcopy
2021-10-24 16:57:03 -04:00
CFLAGS = -Os -fno-stack-protector
2021-10-24 11:23:44 -04:00
LDFLAGS = -T linker.x -nostdlib -nostartfiles
all: $(TARGET).bin
%.bin: %.elf
2021-10-24 16:57:03 -04:00
$(OBJCOPY) -S -j .text -j .data -j .rodata -j .bss -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)