X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=hw2%2Fmakefile;h=fef6181cf37059e3ce8b0b7a3eac18ed075289df;hb=91aaf64a8183d260acd043f4ef53d26f0193c090;hp=118544885d22d14c64510eebc79b77a6c029653b;hpb=b140014d11ca7ce89bda2732f41a2f3f5c1a923e;p=~andy%2Fcsm213a-hw diff --git a/hw2/makefile b/hw2/makefile index 1185448..fef6181 100644 --- a/hw2/makefile +++ b/hw2/makefile @@ -1,13 +1,42 @@ -PROG = mbed -OBJS = main.o serial_dma.o +-include config.mk + +# Common settings +UART0 = /dev/ttyACM0 +UART1 = /dev/ttyACM1 +CLEAN = control tags CPPFLAGS = LDFLAGS = -lm -default: info install +# Common rules +all: mbed.elf tester.elf control + +terms: + 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 $(UART0) 1 + @./control $(UART0) 2 + @./control $(UART0) 2 sync + +# 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