summaryrefslogtreecommitdiff
path: root/avr/Tupfile
diff options
context:
space:
mode:
Diffstat (limited to 'avr/Tupfile')
-rw-r--r--avr/Tupfile32
1 files changed, 26 insertions, 6 deletions
diff --git a/avr/Tupfile b/avr/Tupfile
index 11b5802..d73db12 100644
--- a/avr/Tupfile
+++ b/avr/Tupfile
@@ -1,14 +1,25 @@
include_rules
PROG = stamp-monitor
+
+FATFS = $(TOP)/fatfs/src/ff.c
+
SRC = main.c
SRC += cli.c cli_readline.c command.c command_tbl.c
SRC += cmd_help.c cmd_date.c cmd_mem.c cmd_boot.c cmd_gpio.c cmd_misc.c
-SRC += cmd_sd.c cmd_fat.c
-SRC += env.c xmalloc.c date.c con-utils.c print-utils.c getopt-min.c
-SRC += timer.c serial.c i2c.c pcf8583.c mmc.c
+SRC += cmd_loadihex.c cmd_loadcpm3.c cmd_sd.c cmd_fat.c
+SRC += env.c xmalloc.c con-utils.c print-utils.c getopt-min.c
+SRC += timer.c serial.c i2c.c bcd.c pcf8583.c mmc.c
SRC += background.c z180-serv.c z80-if.c gpio.c
-SRC += $(TOP)/fatfs/src/ff.c
+SRC += $(FATFS) $(TOP)/fatfs/src/option/unicode.c
+
+#TODO: time lib
+SRC += ../time/asctime_r.c ../time/gmtime_r.c ../time/mk_gmtime.c
+SRC += ../time/print_lz.c ../time/isLeap.c
+SRC += ../time/time.c ../time/fatfs_time.c
+SRC += ../time/system_time.c ../time/set_system_time.c
+
+ASRC += ../time/system_tick.S
SRC_Z = ../z180/hdrom.c
@@ -59,25 +70,34 @@ CFLAGS += -fno-split-wide-types
CFLAGS += -fshort-enums
#CFLAGS += -fdiagnostics-color=always
-
#CFLAGS += -save-temps
+CFLAGS_$(FATFS) = -fno-strict-aliasing
CFLAGS += $(INCLUDES)
CPPFLAGS += $(DEFS)
+#ASFLAGS += -Wa,-adhlns=$(<:.S=.lst),-gstabs
+ASFLAGS += -mmcu=$(MCU_TARGET) -x assembler-with-cpp $(ASFLAGS)
+
# Linker flags
LDFLAGS += -Wl,--gc-sections
LDFLAGS += -Wl,--cref
+# Assemble: create object files from assembler source files.
+#.S.o:
+# $(CC) -c $(ALL_ASFLAGS) $< -o $@
+
-!cc = |> ^ CC %f^ $(CC) $(CFLAGS) $(CPPFLAGS) -c %f -o %o |> %B.o
+!as = |> ^ AS %f^ $(CC) $(ASFLAGS) -c %f -o %o |> %B.o
+!cc = |> ^ CC %f^ $(CC) $(CFLAGS) $(CPPFLAGS) $(CFLAGS_%f) -c %f -o %o |> %B.o
!LINK = |> ^ LINK %o^ $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-Map=%O.map %f $(LDLIBS) -o %o |> | %O.map
!OBJCOPY= |> ^ OBJCOPY %o^ $(OBJCOPY) -Oihex %f %o |>
!OBJDUMP= |> ^ OBJDUMP %o^ $(OBJDUMP) -h -S %f > %o |> %O.lss
!SIZE = |> ^ SIZE^ $(SIZE) %f |>
+: foreach $(ASRC) |> !as |> {objs}
: foreach $(SRC) | ../z180/hdrom.h |> !cc |> {objs}
: $(SRC_Z) |> !cc -D'const=const __flash' |> {objs}