aboutsummaryrefslogblamecommitdiffstats
path: root/lib/ic/test/erl_client_c_server_SUITE_data/Makefile.src
blob: e66f6080f44f7c2d09aae577644c200540a44aea (plain) (tree)
1
2
3
4
5


                  
                                                       
  










                                                                          























                                                                      
                 

                                               

                                           















































































                                                                    




                                                        

                                                              

                                                            
                                                                  

                                                            



                                              
                                  

                                                        
                                      



                                                                    
                                    

                                                                   
                                        






                                           
#
# %CopyrightBegin%
# 
# Copyright Ericsson AB 2002-2012. All Rights Reserved.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions 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) $<