]> Pileus Git - ~andy/csm213a-hw/blob - hw2/makefile
fef6181cf37059e3ce8b0b7a3eac18ed075289df
[~andy/csm213a-hw] / hw2 / makefile
1 -include config.mk
2
3 # Common settings
4 UART0    = /dev/ttyACM0
5 UART1    = /dev/ttyACM1
6 CLEAN    = control tags
7
8 CPPFLAGS =
9 LDFLAGS  = -lm
10
11 # Common rules
12 all: mbed.elf tester.elf control
13
14 terms:
15         test -c $(UART0) && term $(UART0) &
16         test -c $(UART1) && term $(UART1) &
17
18 dist:
19         zip mbed.zip makefile ../common.mk *.{c,cpp,h} */*.{cpp,.h}
20
21 # Primary mbed (mbed1/mbed2)
22 mbed.elf: main.o main_time.o main_emit.o main_comm.o \
23         serial_irq.o serial_dma.o timer_dma.o messages.o
24
25 mbed-run: mbed.bin control install.sh
26         @./install.sh $<
27         @./control $(UART0) 1
28         @./control $(UART0) 2
29         @./control $(UART0) 2 sync
30
31 # Testing mbed (mbed3)
32 tester.elf: tester.o serial_irq.o timer_dma.o messages.o
33
34 tester-run: tester.bin install.sh
35         @./install.sh $< /dev/sdb /mnt/usb
36
37 # Controls programs
38 control: control.c messages.h
39         gcc -Wall -o $@ $<
40
41 -include ../config.mk
42 -include ../common.mk