X-Git-Url: http://pileus.org/git/?p=~andy%2Fcsm213a-hw;a=blobdiff_plain;f=hw2%2Fmakefile;fp=hw2%2Fmakefile;h=e7c5b4006ffe77909e783aeed7958813a3f0dbb4;hp=80fdcb8140ea34552a1dc37a50d92422d7145a20;hb=a9299548b2cae6dfe9050dd7d054c5496e5c07c3;hpb=d634f081b7dceacd2b23046f75a8dc54c9f545ff diff --git a/hw2/makefile b/hw2/makefile index 80fdcb8..e7c5b40 100644 --- a/hw2/makefile +++ b/hw2/makefile @@ -1,27 +1,40 @@ -PROG = mbed -UART0 = /dev/ttyACM0 -UART1 = /dev/ttyACM1 -OBJS = main.o serial_irq.o serial_dma.o timer_dma.o +# Common settings +UART0 = /dev/ttyACM0 +UART1 = /dev/ttyACM1 +CLEAN = control tags CPPFLAGS = LDFLAGS = -lm -default: info run +# Common rules +default: all -control: control.c messages.h - gcc -Wall -o $@ $< - -run: all control install.sh - @./install.sh $(PROG).bin - @./control $(UART0) 1 - @./control $(UART1) 2 sync +all: mbed.elf tester.elf 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 serial_irq.o serial_dma.o timer_dma.o + +mbed-run: mbed.bin control install.sh + @./install.sh $< + @./control $(UART0) 1 + @./control $(UART1) 2 sync + +# Testing mbed (mbed3) +tester.elf: tester.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