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
|
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 2002-2012. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
# compliance with the License. You should have received a copy of the
# Erlang Public License along with this software. If not, it can be
# retrieved online at http://www.erlang.org/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# %CopyrightEnd%
#
#
# Makefile.src for erl_client_c_server test
# Note: This file *must* work for both Unix and Windows
#
# We use both `rm' (Unix) and `del' (Windows) for removing files, but
# with a `-' in front so that the error in not finding `rm' (`del') on
# Windows (Unix) is ignored.
#
# VxWorks? XXX
#
.SUFFIXES:
.SUFFIXES: .c .h .erl .idl @obj@ .@EMULATOR@
# Variables from ts:
#
ERL_INCLUDE = @erl_include@
IC_INCLUDE_PATH = @ic_include_path@
IC_LIB = @ic_lib@
ERL_INTERFACE_INCLUDE = @erl_interface_include@
ERL_INTERFACE_LIB = @erl_interface_lib@
ERL_INTERFACE_EILIB = @erl_interface_eilib@
ERL_INTERFACE_THREADLIB = @erl_interface_threadlib@
ERL_INTERFACE_SOCK_LIBS = @erl_interface_sock_libs@
CC = @CC@
## XXX Should set warning flag with a DEBUG_FLAG
CFLAGS = @CFLAGS@ @DEFS@ -I$(ERL_INCLUDE) \
-I$(IC_INCLUDE_PATH) -I$(ERL_INTERFACE_INCLUDE)
LD = @LD@
LDFLAGS = @CROSSLDFLAGS@
LIBS = $(IC_LIB) $(ERL_INTERFACE_LIB) $(ERL_INTERFACE_EILIB) \
$(ERL_INTERFACE_THREADLIB) @LIBS@ $(ERL_INTERFACE_SOCK_LIBS)
ERLC = erlc
# Generated C header files
GEN_H_FILES = \
m__s.h \
m_i__s.h \
oe_erl_c_test__s.h
# Generated C files
GEN_C_FILES = \
m__s.c \
m_i__s.c \
oe_code_m_a.c \
oe_code_m_arr1.c \
oe_code_m_arr2.c \
oe_code_m_arr3.c \
oe_code_m_aseq.c \
oe_code_m_b.c \
oe_code_m_bseq.c \
oe_code_m_dd.c \
oe_code_m_dyn.c \
oe_code_m_dyn_sl.c \
oe_code_m_es.c \
oe_code_m_et.c \
oe_code_m_etseq.c \
oe_code_m_fruit.c \
oe_code_m_lseq.c \
oe_code_m_s.c \
oe_code_m_s_sl.c \
oe_code_m_sarr3.c \
oe_code_m_simple.c \
oe_code_m_ssarr3.c \
oe_code_m_sseq.c \
oe_code_m_ssstr3.c \
oe_code_m_sstr3.c \
oe_code_m_str1.c \
oe_code_m_str3.c \
oe_code_m_strRec.c \
oe_code_m_strRec_str5.c \
oe_code_m_strRec_str7.c \
oe_erl_c_test__s.c
GEN_HRL_FILES = \
m.hrl \
m_i.hrl \
oe_erl_c_test.hrl
GEN_ERL_FILES = \
m.erl \
m_arr2.erl \
m_arr3.erl \
m_i.erl \
m_str3.erl \
oe_erl_c_test.erl
C_FILES = $(GEN_C_FILES) c_server.c callbacks.c
OBJS = $(C_FILES:.c=@obj@)
PGMS = c_server@exe@
ERL_FILES = $(GEN_ERL_FILES) erl_client.erl
EBINS = $(ERL_FILES:.erl=.@EMULATOR@)
all: $(PGMS) $(EBINS)
$(GEN_ERL_FILES) $(GEN_HRL_FILES): c_erl_test.built_erl
$(GEN_C_FILES) $(GEN_H_FILES): c_erl_test.built_c
$(OBJS): $(GEN_C_FILES) $(GEN_H_FILES)
$(EBINS): $(GEN_ERL_FILES) $(GEN_HRL_FILES)
clean:
-rm -f $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
$(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
c_erl_test.built_erl c_erl_test.built_c
-del /F /Q $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
$(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES) \
c_erl_test.built_erl c_erl_test.built_c
$(PGMS): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
c_erl_test.built_c: erl_c_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,c_server}" \
"+{scoped_op_calls,true}" erl_c_test.idl
echo done > c_erl_test.built_c
# If we have scoped operation calls for C, we must have that for
# Erlang as well, if we use the m_i.erl file for calling the server.
c_erl_test.built_erl: erl_c_test.idl
$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" \
"+{scoped_op_calls,true}" "+{timeout,true}" erl_c_test.idl
echo done > c_erl_test.built_erl
.c@obj@:
$(CC) -c -o $*@obj@ $(CFLAGS) $<
.erl.@EMULATOR@:
$(ERLC) -W -I $(IC_INCLUDE_PATH) $<
|