aboutsummaryrefslogblamecommitdiffstats
path: root/lib/ic/test/erl_client_c_server_SUITE_data/Makefile.src
blob: cd34d2b2470ccabbc5962806a4d5a13f2e69ee64 (plain) (tree)





















































































































































                                                                        
#
# %CopyrightBegin%
# 
# Copyright Ericsson AB 2002-2009. 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_libpath@@DS@@ic_lib@

ERL_INTERFACE_INCLUDE = @erl_interface_include@
ERL_INTERFACE_LIB = @erl_interface_libpath@@DS@@erl_interface_lib@
ERL_INTERFACE_EILIB = @erl_interface_libpath@@DS@@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)

clean:	
	-rm -f $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
		$(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)
	-del /F /Q $(OBJS) $(GEN_C_FILES) $(GEN_H_FILES) $(PGMS) \
		$(EBINS) $(GEN_ERL_FILES) $(GEN_HRL_FILES)

$(PGMS): $(OBJS)
	$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

$(GEN_C_FILES) $(GEN_H_FILES): erl_c_test.idl
	$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,c_server}" \
	"+{scoped_op_calls,true}" erl_c_test.idl

# 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.

$(GEN_ERL_FILES) $(GEN_HRL_FILES): erl_c_test.idl
	$(ERLC) -I $(IC_INCLUDE_PATH) "+{be,erl_genserv}" \
	"+{scoped_op_calls,true}"  "+{timeout,true}" erl_c_test.idl

.c@obj@:
	$(CC) -c -o $*@obj@ $(CFLAGS) $<

.erl.@EMULATOR@:
	$(ERLC) -W -I $(IC_INCLUDE_PATH) $<