X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=hw2%2Fmakefile;h=36f60c86d70f0e8370bd42c8c656c2588b928440;hb=f9b0067097963fa87b35d7844de1a30d2c93c005;hp=07982822dc6d5f9c0c50a8310a621a3e61e6e3f5;hpb=d5dd8b1b26fb8e11ffaaaa89d58570a19aaeba7d;p=~andy%2Fcsm213a-hw diff --git a/hw2/makefile b/hw2/makefile index 0798282..36f60c8 100644 --- a/hw2/makefile +++ b/hw2/makefile @@ -1,27 +1,42 @@ -PROG = mbed -UART0 = /dev/ttyACM0 -UART1 = /dev/ttyACM1 -OBJS = main.o test.o serial_irq.o serial_dma.o timer_dma.o +-include config.mk + +# Common settings +UART0 = /dev/ttyACM0 +UART1 = /dev/ttyACM1 +CLEAN = control tags CPPFLAGS = LDFLAGS = -lm -default: info run - -control: control.c messages.h - gcc -Wall -o $@ $< - -run: all control install.sh - @./install.sh $(PROG).bin - @./control $(UART0) 0 - @./control $(UART1) 1 sync +# Common rules +all: mbed.bin tester.bin control terms: - term /dev/ttyACM0 & - term /dev/ttyACM1 & + test -c $(UART0) && term $(UART0) & + test -c $(UART1) && term $(UART1) & dist: zip mbed.zip makefile ../common.mk *.{c,cpp,h} */*.{cpp,.h} +# Primary mbed (mbed1/mbed2) +mbed.elf: main.o main_time.o main_emit.o main_comm.o \ + serial_irq.o serial_dma.o timer_dma.o messages.o + +mbed-run: mbed.bin control install.sh + @./install.sh $< + @./control -d1 $(UART0) + @./control -d2 $(UART0) + @./control -d2 -y $(UART0) + +# Testing mbed (mbed3) +tester.elf: tester.o serial_irq.o timer_dma.o messages.o + +tester-run: tester.bin install.sh + @./install.sh $< /dev/sdb /mnt/usb + +# Controls programs +control: control.c messages.h + gcc -Wall -o $@ $< + -include ../config.mk -include ../common.mk