2023-06-08 10:22:25 +00:00
|
|
|
BUILD_DIR?=../build/gsd_orangecrab/
|
2023-03-07 19:05:21 +00:00
|
|
|
|
|
|
|
include $(BUILD_DIR)/software/include/generated/variables.mak
|
|
|
|
include $(SOC_DIRECTORY)/software/common.mak
|
|
|
|
|
2023-06-07 23:40:48 +00:00
|
|
|
OBJECTS = audio.o can.o crt0.o donut.o led.o main.o
|
2023-05-12 13:01:16 +00:00
|
|
|
CFLAGS += -DWITH_CXX
|
2023-03-07 19:05:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
all: demo.bin
|
|
|
|
|
|
|
|
|
|
|
|
%.bin: %.elf
|
|
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
ifneq ($(OS),Windows_NT)
|
|
|
|
chmod -x $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
vpath %.a $(PACKAGES:%=../%)
|
|
|
|
|
|
|
|
demo.elf: $(OBJECTS)
|
|
|
|
$(CC) $(LDFLAGS) -T linker.ld -N -o $@ \
|
|
|
|
$(OBJECTS) \
|
|
|
|
$(PACKAGES:%=-L$(BUILD_DIR)/software/%) \
|
|
|
|
-Wl,--whole-archive \
|
|
|
|
-Wl,--gc-sections \
|
|
|
|
-Wl,-Map,$@.map \
|
|
|
|
$(LIBS:lib%=-l%)
|
|
|
|
|
|
|
|
ifneq ($(OS),Windows_NT)
|
|
|
|
chmod -x $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
# pull in dependency info for *existing* .o files
|
|
|
|
-include $(OBJECTS:.o=.d)
|
|
|
|
|
|
|
|
donut.o: CFLAGS += -w
|
|
|
|
|
|
|
|
VPATH = $(BIOS_DIRECTORY):$(BIOS_DIRECTORY)/cmds:$(CPU_DIRECTORY)
|
|
|
|
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
$(compilexx)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(compile)
|
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
$(assemble)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJECTS) demo.elf demo.bin .*~ *~
|
|
|
|
|
|
|
|
.PHONY: all clean
|