]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/Tupfile
System time: Init from rtc on startup, update in timer inerrupt.
[z180-stamp.git] / avr / Tupfile
index 6c406493579f87cc659329f45da62a199fd87f41..9fc073984f627f106b14835a9f7338d15e043d7b 100644 (file)
@@ -16,6 +16,9 @@ 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/system_time.c ../time/set_system_time.c
+
+ASRC   += ../time/system_tick.S
 
 SRC_Z          = ../z180/hdrom.c
 
@@ -74,17 +77,26 @@ 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 $@
+
 
+!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}