botsense  3.2.0
RoadNarrows Client-Server Proxied Services Framework
Makefile
Go to the documentation of this file.
1 ################################################################################
2 #
3 # ./examples/unittest/Makefile
4 #
5 ifdef RNMAKE_DOXY
6 /*!
7 \file
8 
9 \brief Python unit test application makefile.
10 
11 RN Make System Specific Makefile
12 
13 \pkgsynopsis
14 RoadNarrows Robotics \h_botsense Client-Server Proxied Services Framework
15 
16 \pkgfile{examples/unittest/Makefile}
17 
18 \pkgauthor{Robin Knight,robin.knight@roadnarrows.com}
19 
20 \pkgcopyright{2010-2018,RoadNarrows LLC,http://www.roadnarrows.com}
21 
22 \license{MIT}
23 
24 \EulaBegin
25 \EulaEnd
26 
27  * \cond RNMAKE_DOXY
28  */
29 endif
30 #
31 ################################################################################
32 
33 #------------------------------------------------------------------------------
34 # Required
35 
36 # Package Root Directory
37 RNMAKE_PKG_ROOT = ../..
38 
39 # Bootstrap package within RN Make System
40 include $(RNMAKE_PKG_ROOT)/make/Bootstrap.mk
41 
42 # command line override
43 ifndef encoding
44  encoding=itv
45 endif
46 ifndef endian
47  endian=big
48 endif
49 
50 XML_OVERRIDES = encoding=$(encoding),endian=$(endian)
51 
52 
53 #------------------------------------------------------------------------------
54 # Programs
55 
56 RNMAKE_TEST_PGMS = nmExample
57 
58 # Libraries to Link With
59 nmExample.LIBS = netmsgs rnr
60 nmExample.LIBDEPS = netmsgs
61 
62 
63 #------------------------------------------------------------------------------
64 # Sources
65 
66 #
67 # C Source Files
68 #
69 nmExample.SRC.C = nmExample.c AstroMsgs.c
70 
71 
72 #------------------------------------------------------------------------------
73 # Extras
74 #
75 
76 # Subpackage C PreProcessor Flags
77 EXTRA_CPPFLAGS = -DLOG -DLOGMOD="\"nmExample\""
78 
79 EXTRA_TGT_ALL = xml-make
80 EXTRA_TGT_DEPS = xml-make
81 EXTRA_TGT_CLEAN = xml-clean
82 
83 # undef to use installed version
84 NETMSGSGENPATH = ../NetMsgs/scripts/
85 
86 # the command
87 NETMSGSGEN = netmsgsgen
88 
89 XML_H_DIR = .
90 XML_IN_FILES = AstroMsgs.xml
91 XML_OUT_H_FILES = $(addprefix $(XML_H_DIR)/,\
92  $(addsuffix .h,$(basename $(XML_IN_FILES))))
93 XML_OUT_C_FILES = $(addsuffix .c,$(basename $(XML_IN_FILES)))
94 
95 define XML_TO_H
96  $(addprefix $(XML_H_DIR)/,$(addsuffix .h,$(basename $(1))))
97 endef
98 
99 define XML_TO_C
100  $(addsuffix .c,$(basename $(1)))
101 endef
102 
103 .PHONY: xml-make
104 xml-make: $(XML_OUT_H_FILES)
105 
106 # Application specific message h and c files
107 $(XML_H_DIR)/%.h : %.xml
108  @echo ""
109  @echo " $(<)"
110  $(NETMSGSGENPATH)$(NETMSGSGEN) --lang=c --overrides="$(XML_OVERRIDES)" \
111  --xml=$(<) $(@) $(call XML_TO_C,$(<))
112 
113 .PHONY: xml-h-clean
114 xml-clean:
115  $(RM) $(XML_OUT_H_FILES)
116  $(RM) $(XML_OUT_C_FILES)
117 
118 
119 #------------------------------------------------------------------------------
120 # Include RNMAKE rules makefile(s)
121 
122 # include top-level rules
123 include $(RNMAKE_ROOT)/Rules.mk
124 
125 
126 ifdef RNMAKE_DOXY
127 /*! \endcond RNMAKE_DOXY */
128 endif