summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/tao_idl.mpc
blob: d8760007ad5521d77823e69101923d0cab4a83be (plain)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// -*- MPC -*-
// $Id$

project(TAO_IDL_GEN) {
  requires += tao_idl_fe_gen
  verbatim(gnuace, local) {
    fe/fe_lookup.cpp: fe/keywords.dat
    "	echo '\/\/ $$I''d$$' > $@"
    "	echo '' >> $@"
    "	echo '#include \"fe_private.h\"' >> $@"
    "	echo '#include \"ace/OS_NS_string.h\"' >> $@"
    "	echo '' >> $@"
    "	$(ACE_ROOT)/bin/ace_gperf -M -J -c -C -D -E -T -f 0 -a -o -t -p -K keyword_ -L C++ -Z TAO_IDL_CPP_Keyword_Table -N lookup -k1,2,$$ $^ | \\"
    "	sed -e 's/,}/,0}/g' \\"
    "	    -e 's/\\*str == \\*s && !ACE_OS::strncmp/len == static_cast<unsigned int> (ACE_OS::strlen (s)) \\&\\& *str == *s \\&\\& !ACE_OS::strncmp/g' \\"
    "	>> $@"

    fe/lex.yy.cpp: fe/idl.ll
    "	@echo 'WARNING: Potentially outdated $@'"
    "	@echo '         either touch(1) the file or explicitly'"
    "	@echo '         generate it using:'"
    "	@echo '    make lex.yy'"

    .PHONY: lex.yy
    lex.yy:
    "ifeq ($(notdir $(LEX)), flex)"
    "	$(LEX) -L -t fe/idl.ll | \\"
    "	sed -e 's/yy/tao_yy/g' \\"
    "	    -e 's/YY/TAO_YY/g' \\"
    "	    -e 's/ NULL/ 0/g' \\"
    "	    -e 's/	/        /g' \\"
    "	    -e 's/  *$$\/\/g' \\"
    "	    -e 's/TAO_YY_BREAK break;/TAO_YY_BREAK ACE_NOTREACHED (break;)/g' \\"
    "	    -e 's/ECHO/TAO_YY_ECHO/' \\"
    "	    -e 's/fread\([^\)]*\)/static_cast<int> (&)/g' \\"
    "	    -e 's/\\$$Hea''der.*\\$$/$$I''d$$/' \\"
    "	    -e 's@#include <stdio\.h>@#include \"ace/os_include/os_stdio.h\"@' \\"
    "	    -e 's@#include <unistd\.h>@#include \"ace/os_include/os_ctype.h\"@' \\"
    "	    -e '/#include </d' \\"
    "	> fe/lex.yy.cpp"
    "	(cd fe; patch < lex.yy.cpp.diff)"
    "else"
    "	@echo 'ERROR: You must use flex 2.5.4 or higher to process this file'"
    "	@/bin/false"
    "endif"

    fe/y.tab.cpp: fe/idl.yy
    "	@echo 'WARNING: Potentially outdated $@'"
    "	@echo '         either touch(1) the file or explicitly'"
    "	@echo '         generate it using:'"
    "	@echo '    make y.tab'"

    .PHONY: y.tab
    y.tab: fe/idl.yy
    "ifeq ($(notdir $(YACC)), bison)"
    "	$(YACC) -y -l -d fe/idl.yy"
    "	sed -e 's/char \\*getenv/char *ace_foo/g' \\"
    "	    -e 's/= getenv/= ACE_OS::getenv/g' \\"
    "	    -e 's/int yynew_state,/int,/g' \\"
    "	    -e 's/int yyold_state,/int,/g' \\"
    "	    -e 's/int yyrule_num,/int,/g' \\"
    "	    -e 's/\\(YYDEBUG_DISCARD_TOKEN.*int\\) yytoken_num/\\1/g' \\"
    "	    -e 's/yynewerror:\/\/g' \\"
    "	    -e 's/yy/tao_yy/g' \\"
    "	    -e 's/YY/TAO_YY/g' \\"
    "	    -e 's/	/        /g' \\"
    "	    -e 's/  *$$\/\/g' \\"
    "	    -e 's/y\\.tab\\.c/y.tab.cpp/g' \\"
    "	    -e 's%\\(#pragma ident\\)%\/\/ \\1%' < y.tab.c > /tmp/$(USER).Y"
    "	sed -e 's/yy/tao_yy/g' \\"
    "	    -e 's/YY/TAO_YY/g' < y.tab.h > /tmp/$(USER).YH"
    "	echo '\/\/ $$I''d$$' > fe/y.tab.cpp"
    "	cat /tmp/$(USER).Y >> fe/y.tab.cpp"
    "	echo '\/\/ $$I''d$$' > fe/y.tab.h"
    "	cat /tmp/$(USER).YH >> fe/y.tab.h"
    "	$(RM) /tmp/$(USER).Y /tmp/$(USER).YH y.tab.c y.tab.h"
    "	(cd fe; patch < y.tab.cpp.diff)"
    "else"
    "	@echo 'ERROR: You must use bison 1.875b or higher to process this file'"
    "	@/bin/false"
    "endif"
  }
}

project(TAO_IDL_EXE) : aceexe, install, tao_output, crosscompile, mcpp, tao_idl_mcpp_local {
  exename      = tao_idl
  libs        += TAO_IDL_BE TAO_IDL_FE
  exeout       = $(ACE_ROOT)/bin
  after       += TAO_IDL_BE gperf
  includes    += $(TAO_ROOT)

  specific (automake) {
    includes    += $(srcdir)/include $(srcdir)/be_include $(srcdir)/fe $(TAO_ROOT)
    macros      += TAO_IDL_INCLUDE_DIR=\"\\"$(includedir)/tao\\"\"
  } else {
    includes    += include be_include fe ..
  }

  specific {
    // Override the template value for optimize.  Building the exe
    // with optimization turned on doesn't seem to work (at least not with
    // vc6 or vc71).  This is due to the use of addresses of static objecs
    // within the code.
    optimize =
  }

  verbatim(gnuace, local) {
    ifeq ($(TAO_IDL_PREPROCESSOR),)
      ifeq ($(ACE_CC_PREPROCESSOR),)
        CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\\\"$(strip $(CXX))\\\"
      else
        CPPFLAGS += -DACE_CC_PREPROCESSOR=\\\"$(subst \\,\\,$(ACE_CC_PREPROCESSOR))\\\"
      endif
    else
      CPPFLAGS += -DTAO_IDL_PREPROCESSOR=\\\"$(subst \\,\\,$(TAO_IDL_PREPROCESSOR))\\\"
    endif
  }

  Source_Files {
    driver/drv_args.cpp
    tao_idl.cpp
  }

  Header_Files {
    include/drv_extern.h
  }
}


project(TAO_IDL_BE) : acelib, conv_lib, tao_output, crosscompile, tao_vc8warnings {
  sharedname   = TAO_IDL_BE
  libs        += TAO_IDL_FE
  dynamicflags = TAO_IDL_BE_BUILD_DLL
  after       += TAO_IDL_FE
  includes    += $(TAO_ROOT)

  specific (automake) {
    includes    += $(srcdir)/include $(srcdir)/be_include $(srcdir)/fe
  } else {
    includes    += include be_include fe
  }

  specific {
    // Override the template value for optimize.  Building the backend
    // with optimization turned on doesn't seem to work (at least not with
    // vc6 or vc71).  This is due to the use of addresses of static objecs
    // within the code.
    optimize =
  }

  Source_Files {
    be
  }

  Header_Files {
    be_include
  }
}


project(TAO_IDL_FE) : acelib, conv_lib, tao_output, crosscompile, fe_mcpp {
  sharedname   = TAO_IDL_FE
  dynamicflags = TAO_IDL_FE_BUILD_DLL
  includes    += $(TAO_ROOT)

  specific (automake) {
    includes    += $(srcdir)/include $(srcdir)/fe
  } else {
    includes    += include fe
  }

  specific {
    // Override the template value for optimize.  Building the frontend
    // with optimization turned on doesn't seem to work (at least not with
    // vc6 or vc71).  This is due to the use of addresses of static objecs
    // within the code.
    optimize =
  }

  Source_Files {
    fe
    ast
    util
    narrow
  }

  Header_Files {
    include
    fe
  }
}