]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blob - rpp/demos/Makefile
Change license to MIT
[pes-rpp/rpp-simulink.git] / rpp / demos / Makefile
1 # Copyright (C) 2013, 2015, 2019 Czech Technical University in Prague
2 #
3 # Authors:
4 #     - Michal Sojka <sojkam1@fel.cvut.cz>
5 #
6 # Permission is hereby granted, free of charge, to any person
7 # obtaining a copy of this software and associated documentation
8 # files (the "Software"), to deal in the Software without
9 # restriction, including without limitation the rights to use,
10 # copy, modify, merge, publish, distribute, sublicense, and/or sell
11 # copies of the Software, and to permit persons to whom the
12 # Software is furnished to do so, subject to the following
13 # conditions:
14
15 # The above copyright notice and this permission notice shall be
16 # included in all copies or substantial portions of the Software.
17
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 # OTHER DEALINGS IN THE SOFTWARE.
26 #
27 # File : Makefile
28 # Abstract:
29 #     Build demos
30
31 include ../lib/Makefile.config
32
33 DEMOS = $(demos_$(TARGET))
34
35 demos_rm48_hdk = $(demos_hdk)
36 demos_tms570_hdk = $(demos_hdk)
37 demos_tms570_hydctr = $(demos_hydctr)
38
39 demos_hdk =                             \
40         adc_demo_hdk                    \
41         adc_overrun_test                \
42         can_ext_mode_demo               \
43         can_simple_demo                 \
44         cantransmit                             \
45         continuous_hdk                  \
46         demo_board_hdk                  \
47         echo_char                               \
48         gio_demo_hdk                    \
49         hello_world                             \
50         multirate_st_hdk                \
51         ext_mode_serial                 \
52         ext_mode_tcpip                  \
53         multirate_mt_hdk
54
55 demos_hydctr =                          \
56         $(demos_hdk)                    \
57     board_init_hydctr
58
59 demos_tms570_rpp =                               \
60         analog_passthrough_rpp           \
61         analog_sinewave_rpp              \
62         can_demo                                         \
63         can_ext_mode_demo                        \
64         cantransmit                              \
65         demo_board_rpp                           \
66         digital_passthrough_rpp          \
67         echo_char                                        \
68         fray_basic_demo_rpp              \
69         fray_motor_demo_rpp              \
70         hbridge_analog_control_rpp       \
71         hbridge_digital_control_rpp  \
72         hbridge_sinewave_control_rpp \
73         hello_world                              \
74         irc_input_rpp                            \
75         led_blink_all_rpp                        \
76         led_blink_rpp                            \
77         log_analog_input_rpp             \
78         power_toggle_rpp                         \
79         three_phase_freq_rpp
80
81 # Check that each demo is used for least one target
82 all_demos = $(wildcard *.slx)
83 unused_demos = $(filter-out $(sort $(demos_hdk) $(demos_hydctr) $(demos_tms570_rpp)),$(all_demos:%.slx=%))
84 missing_demos = $(filter-out $(all_demos:%.slx=%),$(sort $(DEMOS)))
85 $(if $(unused_demos),$(error Unused demos: $(unused_demos)))
86 $(if $(missing_demos),$(error Missing demos: $(missing_demos)))
87
88 all: lib
89         matlab -nojvm -r "try; rpp_build_demos $(DEMOS); catch ME, disp(getReport(ME)); exit(1); end; exit(0)"
90
91 lib:
92         $(MAKE) -C ../lib rpp-lib.lib
93
94 MODELS=$(wildcard *.slx)
95 BUILD_DIRS=$(MODELS:%.slx=%_rpp)
96 clean:
97         rm -rf $(BUILD_DIRS)
98
99 .PHONY: print
100 print: # Used by buildbot
101         @echo $(DEMOS)