-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile.rc2014
44 lines (31 loc) · 1.04 KB
/
Makefile.rc2014
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
TARGET_EXEC ?= fnconfig
BUILD_DIR ?= ./build
SRC_DIRS ?= ./src
LIB_PROJECT := -l../fujinet-rc2014/libfn_cpm -l../fujinet-rc2014/libfujinet
LIB_PROJECT_INC := ../fujinet-rc2014/lib/include
CC=zcc
AS=zcc
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *_rc2014.asm)
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:.o=.d)
CFLAGS=+cpm -DBUILD_RC2014 -I$(LIB_PROJECT_INC) -compiler=sdcc -clib=ansi -pragma-redirect:fputc_cons=fputc_cons_generic
LDFLAGS=+cpm -create-app -I$(LIB_PROJECT_INC) -o$(TARGET_EXEC)
ASFLAGS=+cpm
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) $(LIB_PROJECT)
#cp autorun.ddp ../fujinet-platformio/data/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 FNCONFIG* fnconfig* $(BUILD_DIR)
-include $(DEPS)
MKDIR_P ?= mkdir -p