summaryrefslogtreecommitdiff
path: root/src/Makefile.proto
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile.proto')
-rw-r--r--src/Makefile.proto217
1 files changed, 217 insertions, 0 deletions
diff --git a/src/Makefile.proto b/src/Makefile.proto
new file mode 100644
index 00000000..958b7572
--- /dev/null
+++ b/src/Makefile.proto
@@ -0,0 +1,217 @@
+#
+# AltOS build
+#
+#
+vpath %.c ..
+vpath %.h ..
+vpath make-altitude ..
+vpath ao-make-product.5c ..
+
+CC=sdcc
+
+ifndef VERSION
+VERSION=$(shell git describe)
+endif
+
+CFLAGS=--model-small --debug --opt-code-speed
+
+LDFLAGS=--out-fmt-ihx --code-loc 0x0000 --code-size 0x8000 \
+ --xram-loc 0xf000 --xram-size 0xda2 --iram-size 0xff
+
+INC = \
+ ao.h \
+ ao_pins.h \
+ cc1111.h \
+ altitude.h \
+ 25lc1024.h
+
+#
+# Common AltOS sources
+#
+ALTOS_SRC = \
+ ao_cmd.c \
+ ao_dma.c \
+ ao_mutex.c \
+ ao_panic.c \
+ ao_task.c \
+ ao_timer.c \
+ _bp.c
+
+#
+# Shared AltOS drivers
+#
+ALTOS_DRIVER_SRC = \
+ ao_beep.c \
+ ao_config.c \
+ ao_led.c \
+ ao_radio.c \
+ ao_stdio.c \
+ ao_usb.c
+
+TELE_COMMON_SRC = \
+ ao_packet.c \
+ ao_packet_slave.c \
+ ao_state.c
+
+#
+# Receiver code
+#
+TELE_RECEIVER_SRC =\
+ ao_monitor.c \
+ ao_gps_print.c \
+ ao_packet_master.c \
+ ao_rssi.c
+
+#
+# Shared Tele drivers (on TeleMetrum, TeleTerra, TeleDongle)
+#
+
+TELE_DRIVER_SRC = \
+ ao_convert.c \
+ ao_serial.c
+
+#
+# Debug dongle driver (only on TI)
+#
+DBG_SRC = \
+ ao_dbg.c
+
+#
+# Drivers only on TeleMetrum
+#
+TM_DRIVER_SRC = \
+ ao_adc.c \
+ ao_gps_report.c \
+ ao_ignite.c
+
+#
+# 25LC1024 driver source
+EE_DRIVER_SRC = \
+ ao_ee.c
+
+#
+# AT45DB161D driver source
+
+FLASH_DRIVER_SRC = \
+ ao_flash.c
+
+#
+# SiRF driver source
+#
+SIRF_DRIVER_SRC = \
+ ao_gps_sirf.c
+#
+# Skytraq driver source
+#
+SKY_DRIVER_SRC = \
+ ao_gps_skytraq.c
+
+#
+# Tasks run on TeleMetrum
+#
+TM_TASK_SRC = \
+ ao_flight.c \
+ ao_log.c \
+ ao_report.c \
+ ao_telemetry.c
+
+TM_MAIN_SRC = \
+ ao_telemetrum.c
+
+#
+# Base sources for TeleMetrum
+#
+TM_BASE_SRC = \
+ $(ALTOS_SRC) \
+ $(ALTOS_DRIVER_SRC) \
+ $(TELE_DRIVER_SRC) \
+ $(TELE_COMMON_SRC) \
+ $(TM_DRIVER_SRC) \
+ $(TM_TASK_SRC) \
+ $(TM_MAIN_SRC)
+
+TI_MAIN_SRC = \
+ ao_tidongle.c
+
+#
+# All sources for the TI debug dongle
+#
+TI_SRC = \
+ $(ALTOS_SRC) \
+ $(ALTOS_DRIVER_SRC) \
+ $(TELE_RECEIVER_SRC) \
+ $(TELE_COMMON_SRC) \
+ $(TI_MAIN_SRC) \
+ $(DBG_SRC)
+
+TT_MAIN_SRC = \
+ ao_teleterra.c
+#
+# All sources for TeleTerra
+#
+TT_SRC = \
+ $(ALTOS_SRC) \
+ $(ALTOS_DRIVER_SRC) \
+ $(TELE_RECEIVER_SRC) \
+ $(TELE_DRIVER_SRC) \
+ $(TELE_COMMON_SRC) \
+ $(TT_MAIN_SRC)
+
+
+#
+# Sources for TeleDongle
+#
+
+TD_MAIN_SRC = \
+ ao_teledongle.c
+
+TD_SRC = \
+ $(ALTOS_SRC) \
+ $(ALTOS_DRIVER_SRC) \
+ $(TELE_RECEIVER_SRC) \
+ $(TELE_COMMON_SRC) \
+ $(TD_MAIN_SRC)
+
+include Makefile.defs
+
+REL=$(SRC:.c=.rel) ao_product.rel
+ADB=$(REL:.rel=.adb)
+ASM=$(REL:.rel=.asm)
+LNK=$(REL:.rel=.lnk)
+LST=$(REL:.rel=.lst)
+RST=$(REL:.rel=.rst)
+SYM=$(REL:.rel=.sym)
+
+PCDB=$(PROG:.ihx=.cdb)
+PLNK=$(PROG:.ihx=.lnk)
+PMAP=$(PROG:.ihx=.map)
+PMEM=$(PROG:.ihx=.mem)
+PAOM=$(PROG:.ihx=)
+
+%.rel : %.c $(INC)
+ $(CC) -c $(CFLAGS) -o$@ $<
+
+all: $(PROG)
+
+$(PROG): $(REL) Makefile Makefile.defs ../Makefile.proto
+ $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(REL)
+
+../altitude.h: make-altitude
+ nickle $< > $@
+
+ao_product.h: ao-make-product.5c
+ nickle $< -m altusmetrum.org -p $(PRODUCT) -v $(VERSION) > $@
+
+ao_product.rel: ao_product.c ao_product.h
+ $(CC) -c $(CFLAGS) -D PRODUCT_DEFS='\"ao_product.h\"' -o$@ $<
+
+distclean: clean
+
+clean:
+ rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
+ rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
+ rm -f ao_product.h
+
+install:
+
+uninstall: