forked from FujiNetWIFI/fujinet-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.adam
47 lines (33 loc) · 1.05 KB
/
Makefile.adam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
TARGET_EXEC ?= autorun.ddp
BUILD_DIR ?= ./build
SRC_DIRS ?= ./src
ADDL_DIR1 := ../eoslib/src
ADDL_DIR2 := ../smartkeyslib/src
ADDL_LIB1 := ../eoslib/eos.lib
ADDL_LIB2 := ../smartkeyslib/smartkeys.lib
CC=zcc
AS=zcc
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *_adam.asm)
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:.o=.d)
CFLAGS=+coleco -subtype=adam -DBUILD_ADAM -I$(ADDL_DIR1) -I$(ADDL_DIR2)
LDFLAGS=+coleco -subtype=adam -create-app -o$(TARGET_EXEC) -lndos -l$(ADDL_LIB1) -l$(ADDL_LIB2)
ASFLAGS=+coleco -subtype=adam
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CC) $(LDFLAGS) $(OBJS)
cp autorun.ddp ../fujinet-platformio/data/webui/device_specific/BUILD_ADAM/
# c source
$(BUILD_DIR)/%.c.o: %.c
$(MKDIR_P) $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
# asm source
$(BUILD_DIR)/%.asm.o: %.asm
$(MKDIR_P) $(dir $@)
$(AS) $(ASFLAGS) -c $< -o $@
.PHONY: clean
clean:
$(RM) -r autorun* $(BUILD_DIR)
-include $(DEPS)
MKDIR_P ?= mkdir -p