File: vxprogen

package info (click to toggle)
poco 1.14.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 56,460 kB
  • sloc: cpp: 340,542; ansic: 245,601; makefile: 1,742; yacc: 1,005; sh: 698; sql: 312; lex: 282; xml: 128; perl: 29; python: 24
file content (171 lines) | stat: -rwxr-xr-x 3,349 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#
# vxprogen
#
# Project file generator for WindRiver Tornado 2.2/VxWorks 5.5
#
# Usage: vxprogen <buildspec>...
#
# The tool must be started from a project directory
# (e.g. $POCO_BASE/Foundation). The build specification
# file must be located in the vx directory within
# the project directory, named vx.build.
# One or more build specification names can be specified.
#
# The environment variable POCO_BASE must be set.
#

if [ "$1" = "" ] ; then
	echo "usage: $0 <buildspec>..."
	exit 0
fi

if [ "$POCO_BASE" = "" ] ; then
	echo "Fatal error: POCO_BASE not set. Exiting."
	exit 1
fi

if [ ! -d "$POCO_BASE" ] ; then
	echo "Fatal error: POCO_BASE does not contain a valid path to a directory. Exiting."
	exit 1
fi

pwd=`pwd`
buildfile=`basename $pwd`.vxbuild

if [ ! -f $buildfile ] ; then
	echo "Fatal error: vx/vx.build not found. Exiting."
	exit 1
fi

builds=""
while [ "$1" != "" ] ; do
	if [ ! -f "$POCO_BASE/build/vxconfig/$1" ] ; then
		echo "Fatal error: no build specification file for $1 found. Exiting."
		exit 1
	fi
	builds="$builds $1"
	current=$1
	shift
done

source $buildfile

out=vx/${TARGET}.wpj

mkdir -p vx

echo "Document file - DO NOT EDIT" >$out
echo "" >>$out

buildvars="
	MACRO_AR
	MACRO_ARCHIVE
	MACRO_AS
	MACRO_CC
	MACRO_CC_ARCH_SPEC
	MACRO_CFLAGS
	MACRO_CFLAGS_AS
	MACRO_CPP
	MACRO_HEX_FLAGS
	MACRO_LD
	MACRO_LDFLAGS
	MACRO_LD_PARTIAL
	MACRO_LD_PARTIAL_FLAGS
	MACRO_NM
	MACRO_OPTION_DEFINE_MACRO
	MACRO_OPTION_DEPEND
	MACRO_OPTION_GENERATE_DEPENDENCY_FILE
	MACRO_OPTION_INCLUDE_DIR
	MACRO_OPTION_LANG_C
	MACRO_OPTION_UNDEFINE_MACRO
	MACRO_POST_BUILD_RULE
	MACRO_PRJ_LIBS
	MACRO_SIZE
	MACRO_TOOL_FAMILY
	RO_DEPEND_PATH
	TC
"

for build in $builds ; do
	source $POCO_BASE/build/vxconfig/$build

	echo "<BEGIN> BUILD_${BUILD}_BUILDRULE" >>$out
	echo "${TARGET}.out" >>$out
	echo "<END>" >>$out
	echo "" >>$out

	for buildvar in $buildvars ; do
		echo "<BEGIN> BUILD_${BUILD}_${buildvar}" >>$out
		eval echo \"\$$buildvar\" >>$out
		echo "<END>" >>$out
		echo "" >>$out
	done
done

echo "<BEGIN> BUILD_RULE_archive" >>$out
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out

echo "<BEGIN> BUILD_RULE_${TARGET}.out" >>$out
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out

echo "<BEGIN> BUILD_RULE_${TARGET}.pl" >>$out
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out

echo "<BEGIN> BUILD_RULE_objects" >>$out
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out

echo "<BEGIN> BUILD__CURRENT" >>$out
echo "$current" >>$out
echo "<END>" >>$out
echo "" >>$out

echo "<BEGIN> BUILD__LIST" >>$out
echo $builds >>$out
echo "<END>" >>$out
echo "" >>$out

echo "<BEGIN> CORE_INFO_TYPE" >>$out
echo "::prj_vxApp" >>$out
echo "<END>" >>$out
echo "" >>$out

echo "<BEGIN> CORE_INFO_VERSION" >>$out
echo "2.2" >>$out
echo "<END>" >>$out
echo "" >>$out

for src in $SOURCES ; do
	echo "<BEGIN> FILE_\$(PRJ_DIR)/../src/${src}_objects" >>$out
	echo "${src%.*}.o" >>$out
	echo "<END>" >>$out
	echo "" >>$out

	echo "<BEGIN> FILE_\$(PRJ_DIR)/../src/${src}_tool" >>$out
	echo "C/C++ compiler" >>$out
	echo "<END>" >>$out
	echo "" >>$out
done

echo "<BEGIN> PROJECT_FILES" >>$out
prefix=""
for src in $SOURCES ; do
	echo -n "$prefix\$(PRJ_DIR)/../src/$src" >>$out
	prefix=" \\
	"
done
echo "" >>$out
echo "<END>" >>$out
echo "" >>$out

echo "<BEGIN> userComments" >>$out
echo "Generated on `date`" >>$out
echo "<END>" >>$out
echo "" >>$out