]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blob - rpp-test-sw/Makefile.inc
Merge branches 'master' and 'rm48/master'
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / Makefile.inc
1 makefile_inc_dir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
2
3 all: rpp-test-sw.out
4
5 # Use the configuration "exported" by library build
6 CONFIG = $(makefile_inc_dir)/../rpp-lib/Makefile.config
7 ifneq ($(wildcard $(CONFIG)),)
8 include $(CONFIG)
9 else
10 $(error "rpp-lib not compiled! Either run `make -C $(makefile_inc_dir)/../rpp-lib/build/<target>/Release` or build the appropriate CCS project.")
11 endif
12
13 include $(makefile_inc_dir)/../rpp-lib/build/Makefile.rules
14 include $(makefile_inc_dir)/../rpp-lib/common.mk
15
16 SOURCES = \
17         cmdproc/src/cmdproc.c \
18         cmdproc/src/cmdproc_freertos.c \
19         cmdproc/src/cmdproc_io.c \
20         cmdproc/src/cmdproc_io_line.c \
21         cmdproc/src/cmdproc_io_std_line.c \
22         cmdproc/src/cmdproc_io_tisci.c \
23         cmdproc/src/cmdproc_run.c \
24         cmdproc/src/cmdproc_utils.c \
25         cmdproc/src/i2str.c \
26         commands/cmd.c \
27         commands/cmd_adc.c \
28         commands/cmd_can.c \
29         commands/cmd_pin.c \
30         commands/cmd_port.c \
31         commands/main.c
32
33 SOURCES_tms570_rpp = \
34         commands/cmd_dac.c \
35         commands/cmd_din.c \
36         commands/cmd_emac.c \
37         commands/cmd_fray.c \
38         commands/cmd_fr_basic_test.c \
39         commands/cmd_hbr.c \
40         commands/cmd_hout.c \
41         commands/cmd_lin.c \
42         commands/cmd_lout.c \
43         commands/cmd_motor_example.c \
44         commands/cmd_nc.c \
45         commands/cmd_netstats.c \
46         commands/cmd_sdram.c \
47         commands/cmd_spi.c \
48         commands/cmd_vbat.c
49
50
51 SOURCES += $(SOURCES_$(TARGET))
52
53 OBJS = $(SOURCES:%.c=%.obj)
54
55 RPP_CFLAGS += -I$(makefile_inc_dir)/cmdproc/include -I$(makefile_inc_dir)
56 RPP_CFLAGS += -I. # For version.h
57
58 rpp-test-sw.out: $(OBJS) $(RPP_LIB_DIR)/rpp-lib.lib
59         $(LD) $(RPP_CFLAGS) $(RPP_LDFLAGS) $(OBJS) $(RPP_LDLIBS) -o $@
60
61 $(makefile_inc_dir)/commands/main.c: version.h
62 $(makefile_inc_dir)/commands/cmd.c: version.h
63 include $(makefile_inc_dir)/Makefile.version
64
65 $(OBJS): %.obj: $(makefile_inc_dir)/%.c
66         $(call mkdir,$(dir $@))
67         $(RPP_COMPILE_CMD)
68
69 clean::
70         $(call rm,rpp-test-sw.out $(OBJS))
71
72 -include $(OBJS:%=%.dep)