686fde0c7404a063815f85814a15e1a5b7518ba7
[fw/altos] / src / test / Makefile
1 vpath % ..:../core:../drivers:../util:../micropeak:../aes:../product
2
3 PROGS=ao_flight_test ao_flight_test_baro ao_flight_test_accel ao_flight_test_noisy_accel ao_flight_test_mm \
4         ao_gps_test ao_gps_test_skytraq ao_gps_test_ublox ao_convert_test ao_convert_pa_test ao_fec_test \
5         ao_aprs_test ao_micropeak_test ao_fat_test ao_aes_test ao_int64_test \
6         ao_ms5607_convert_test ao_quaternion_test
7
8 INCS=ao_kalman.h ao_ms5607.h ao_log.h ao_data.h altitude-pa.h altitude.h ao_quaternion.h
9
10 KALMAN=make-kalman 
11
12 CFLAGS=-I.. -I. -I../core -I../drivers -I../micropeak -I../product -O0 -g -Wall
13
14 all: $(PROGS) ao_aprs_data.wav
15
16 clean:
17         rm -f $(PROGS) ao_aprs_data.wav run-out.baro run-out.full
18
19 install:
20
21 ao_flight_test: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c altitude.h $(INCS)
22         cc $(CFLAGS) -o $@ $<
23
24 ao_flight_test_noisy_accel: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c $(INCS)
25         cc -DNOISY_ACCEL=1 $(CFLAGS) -o $@ $<
26
27 ao_flight_test_baro: ao_flight_test.c ao_host.h ao_flight.c  ao_sample.c ao_kalman.c $(INCS)
28         cc $(CFLAGS) -o $@ -DHAS_ACCEL=0 ao_flight_test.c
29
30 ao_flight_test_accel: ao_flight_test.c ao_host.h ao_flight.c  ao_sample.c ao_kalman.c $(INCS)
31         cc $(CFLAGS) -o $@ -DFORCE_ACCEL=1 ao_flight_test.c
32
33 ao_flight_test_mm: ao_flight_test.c ao_host.h ao_flight.c ao_sample.c ao_kalman.c ao_pyro.c ao_pyro.h $(INCS)
34         cc -DTELEMEGA=1 $(CFLAGS) -o $@ $< -lm
35
36 ao_gps_test: ao_gps_test.c ao_gps_sirf.c ao_gps_print.c ao_host.h
37         cc $(CFLAGS) -o $@ $<
38
39 ao_gps_test_skytraq: ao_gps_test_skytraq.c ao_gps_skytraq.c ao_gps_print.c ao_gps_show.c ao_host.h
40         cc $(CFLAGS) -o $@ $<
41
42 ao_gps_test_ublox: ao_gps_test_ublox.c ao_gps_ublox.c ao_gps_print.c ao_gps_show.c ao_host.h ao_gps_ublox.h
43         cc $(CFLAGS) -o $@ $<
44
45 ao_convert_test: ao_convert_test.c ao_convert.c altitude.h
46         cc $(CFLAGS) -o $@ $<
47
48 ao_convert_pa_test: ao_convert_pa_test.c ao_convert_pa.c altitude-pa.h
49         cc $(CFLAGS) -o $@ $<
50
51 ao_kalman.h: $(KALMAN)
52         (cd .. && make ao_kalman.h)
53
54 ao_fec_test: ao_fec_test.c ao_fec_tx.c ao_fec_rx.c
55         cc $(CFLAGS) -DAO_FEC_DEBUG=1 -o $@ ao_fec_test.c ../core/ao_fec_tx.c ../core/ao_fec_rx.c -lm
56
57 ao_aprs_test: ao_aprs_test.c ao_aprs.c
58         cc $(CFLAGS) -o $@ ao_aprs_test.c
59
60 SOX_INPUT_ARGS=--type raw --encoding unsigned-integer -b 8 -c 1 -r 9600
61 SOX_OUTPUT_ARGS=--type wav
62
63 ao_aprs_data.wav: ao_aprs_test
64         ./ao_aprs_test | sox $(SOX_INPUT_ARGS) - $(SOX_OUTPUT_ARGS) $@
65
66 check: ao_fec_test ao_flight_test ao_flight_test_baro run-tests
67         ./ao_fec_test && ./run-tests
68
69 ao_micropeak_test: ao_micropeak_test.c ao_microflight.c ao_kalman.h
70         cc $(CFLAGS) -o $@ ao_micropeak_test.c -lm
71
72 ao_fat_test: ao_fat_test.c ao_fat.c ao_bufio.c
73         cc $(CFLAGS) -o $@ ao_fat_test.c -lssl -lcrypto
74
75 ao_aes_test: ao_aes_test.c ao_aes.c ao_aes_tables.c
76         cc $(CFLAGS) -o $@ ao_aes_test.c
77
78 ao_int64_test: ao_int64_test.c ao_int64.c ao_int64.h
79         cc $(CFLAGS) -o $@ ao_int64_test.c
80
81 ao_ms5607_convert_test: ao_ms5607_convert_test.c ao_ms5607_convert_8051.c ao_int64.c ao_int64.h
82         cc $(CFLAGS) -o $@ ao_ms5607_convert_test.c
83
84 ao_quaternion_test: ao_quaternion_test.c ao_quaternion.h
85         cc $(CFLAGS) -o $@ ao_quaternion_test.c -lm