Commit 2b336f90 authored by Claes Sjöfors's avatar Claes Sjöfors

pwre configure script added for MacOS

parent e2237106
......@@ -3,7 +3,7 @@ link_rule_mk := 1
link = $(ldxx) -shared -DHW_X86 -DOS_LINUX \
-L${pwr_elib} \
-L${pwr_lib} \
-L${pwr_lib} $(pwre_conf_libdir) \
${pwre_broot}/${pwre_target}/bld/lib/co/*.o \
$(rt_msg_eobjs) \
${pwre_broot}/${pwre_target}/bld/lib/msg_dummy/msg_dummy_qcom.o \
......@@ -25,9 +25,9 @@ link = $(ldxx) -shared -DHW_X86 -DOS_LINUX \
${pwre_broot}/${pwre_target}/bld/exe/jpwr_rt_gdh/jpwr_rt_gdh.o \
${pwre_broot}/${pwre_target}/bld/lib/statussrv/*.o \
${pwre_broot}/${pwre_target}/exp/obj/stdsoap2.o \
-o ${pwr_exe}/libjpwr_rt_gdh.so $(pwre_conf_lib)
-o ${pwr_exe}/libjpwr_rt_gdh.so $(pwre_conf_libpwrotherio) $(pwre_conf_lib) -lpwr_dtt
# -lm -lpthread -lrt -lcrypt -lpwr_dtt -lpwr_usbio_dummy -ldb
# -lm -lpthread -lrt -lcrypt -lpwr_dtt -lpwr_usbio_dummy -ldb
# -lSM -lICE -lImlib -lMrm -lXm -lXpm -lXt -lX11 -lXext -lXp\
# ${pwre_broot}/${pwre_target}/bld/lib/flow/*.o \
......
......@@ -39,7 +39,7 @@ realclean : clean $(clean_obj)
# @ echo "Copying libusbio.a"
# @ $(cp) $(cpflags) $(source) $(target)
$(inc_dir)/libusbio.h : ../libusbio.h
$(inc_dir)/libusbio.h : ../../libusbio.h
@ echo "Copying libusbio.h"
@ $(cp) $(cpflags) $(source) $(target)
......
......@@ -23,4 +23,6 @@ lib : $(export_lib) export_lib_local
export_lib_local : $(export_c)
@ echo "Inserting local lib"
@ $(ar) -r $(export_lib) $(export_c)
@ if [ "$(export_c)" != "" ]; then \
$(ar) -r $(export_lib) $(export_c); \
fi
......@@ -465,7 +465,7 @@ $(doc_dir)/sv_se/%.css $(doc_dir)/en_us/%.css :: $(pwre_sroot)/doc/man/src/%.css
# all-purpose rule for graphics/media
$(doc_dir)/% :: $(pwre_sroot)/doc/man/src/%
@ echo "copy $(source)"
@ cp -u $(source) $(target)
@ cp $(source) $(target)
# Rule for creating titlepage xsl templates
$(pwre_sroot)/doc/man/src/pwrtitlepages.xsl :: $(pwre_sroot)/doc/man/src/pwrtitlepage.spec.xml
......
......@@ -5,7 +5,7 @@ ifeq ($(export_type),exp)
link = $(ld) $(explinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs) \
$(pwr_obj)/rt_io_user.o \
$(pwre_conf_libpwrrt) $(pwre_conf_lib)
$(pwre_conf_libpwrrt) $(pwre_conf_lib) $(pwre_conf_libpwrotherio)
else
link = $(ld) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs) \
......
......@@ -4,6 +4,6 @@ link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs)\
$(pwr_obj)/rt_io_user.o -L$(pwr_elib) \
-lpwr_rt -lpwr_co -lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt -lcrypt
$(pwre_conf_libpwrrt) $(pwre_conf_lib)
endif
# exe_generic.mk -- generic makefile for executables
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# To build an executable.
#
ifndef exe_generic_mk
exe_generic_mk := 1
ifndef variables_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif
ifndef link_rule_mk
link_rule := link_rule.mk
-include $(link_rule)
endif
ifndef link_rule_mk
link_rule := ../link_rule.mk
-include $(link_rule)
endif
ifndef link_rule_mk
link_rule := $(pwre_kroot)/tools/bld/src/$(os_name)/link_rule_generic.mk
include $(link_rule)
endif
vpath %.c $(hw_source):$(os_source):$(co_source)
vpath %.cpp $(hw_source):$(os_source):$(co_source)
vpath %.l $(hw_source):$(os_source):$(co_source)
vpath %.h $(hw_source):$(os_source):$(co_source)
vpath %.hpp $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source)
c_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.c $(dir)/*.cpp) \
), $(notdir $(file)) \
) \
)
l_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.l) \
), $(notdir $(file)) \
) \
)
h_includes := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.h) \
), $(notdir $(file)) \
) \
)
hpp_includes := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.hpp) \
), $(notdir $(file)) \
) \
)
exe_name := $(comp_name)
exe_source := $(filter $(exe_name).%, $(c_sources))
c_sources := $(filter-out $(exe_source), $(c_sources))
export_exe := $(exe_dir)/$(exe_name)$(exe_ext)
#export_obj := $(obj_dir)/$(exe_name)$(obj_ext)
export_obj := $(bld_dir)/$(exe_name)$(obj_ext)
export_includes := $(addprefix $(inc_dir)/,$(h_includes) $(hpp_includes))
l_targets := $(addprefix $(bld_dir)/,$(basename $(l_sources)))
l_targets := $(addsuffix $(c_ext),$(l_targets))
objects := $(addprefix $(bld_dir)/,$(basename $(c_sources)))
objects += $(addprefix $(bld_dir)/,$(basename $(l_sources)))
objects := $(strip $(addsuffix $(obj_ext),$(objects)))
lc_src_dep := $(objects:$(obj_ext)=$(d_ext))
exe_src_dep := $(obj_dir)/$(exe_name)$(d_ext)
source_dependencies := $(lc_src_dep) $(exe_src_dep)
link_dependencies := $(bld_dir)/$(exe_name)$(d_ld_ext)
clean_h_includes := $(patsubst %.h,clean_%.h, $(h_includes))
clean_hpp_includes := $(patsubst %.hpp,clean_%.hpp, $(hpp_includes))
.PHONY : all init copy lib exe clean realclean \
dirs $(clean_includes) clean_bld clean_dirs\
clean_exe
all : init copy lib exe
init : dirs
copy : $(export_includes)
lib :
exe : $(l_targets) $(objects) $(export_obj) $(export_exe)
dirs : $(bld_dir)$(dir_ext)
$(bld_dir)$(dir_ext) :
@ $(mkdir) $(mkdirflags) $(basename $@)
clean : clean_exe clean_bld
realclean : clean $(clean_h_includes) $(clean_hpp_includes) clean_dirs
$(export_exe) : $(link_rule) $(export_obj) $(objects)
@ $(log_link_exe)
@ $(link)
clean_exe :
@ if [ -e $(export_exe) ]; then \
$(rm) $(export_exe); \
fi
@ if [ -e $(export_obj) ]; then \
$(rm) $(export_obj); \
fi
clean_bld :
@ $(rm) $(rmflags) $(bld_dir)/*
clean_dirs :
@ $(rm) $(rmflags) $(bld_dir)
$(clean_h_includes) : clean_%.h : %.h
@ $(rm) $(rmflags) $(inc_dir)/$*.h
$(clean_hpp_includes) : clean_%.hpp : %.hpp
@ $(rm) $(rmflags) $(inc_dir)/$*.hpp
-include $(source_dependencies)
-include $(link_dependencies)
endif
# variables.mk -- variables common to all makefiles
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# <Description>
#
ifndef variables_mk
variables_mk := 1
release_root := $(pwre_broot)/$(os_name)/$(hw_name)
module_root := $(release_root)/$(pwre_bmodule)
export_type := $(export_type)
exe_dir := $(module_root)/exe
lib_dir := $(module_root)/lib
obj_dir := $(module_root)/obj
cnf_dir := $(module_root)/cnf
db_dir := $(module_root)/db
inc_dir := $(module_root)/inc
lis_dir := $(module_root)/lis
kit_dir := $(module_root)/kit
src_dir := $(module_root)/src
load_dir := $(module_root)/load
doc_dir := $(release_root)/exp/doc
elib_dir := $(release_root)/exp/lib
einc_dir := $(release_root)/exp/inc
eobj_dir := $(release_root)/exp/obj
eexe_dir := $(release_root)/exp/exe
bld_dir := $(release_root)/bld/$(type_name)/$(comp_name)
tmp_dir := $(release_root)/tmp
c_ext := .c
d_ext := .d
d_ld_ext:= .d_ld
h_ext := .h
lib_ext := .a
obj_ext := .o
map_ext := .map
# Full names of source directories
fhw_source := $(pwre_sroot)/$(type_name)/$(comp_name)/src/$(os_name)/$(hw_name)
fos_source := $(pwre_sroot)/$(type_name)/$(comp_name)/src/$(os_name)
fco_source := $(pwre_sroot)/$(type_name)/$(comp_name)/src
# Relative names of source directories
hw_source := .
os_source := ../
co_source := ../../
ifndef pwre_lang
lang_dir := $(exe_dir)
lang_bld_dir := $(bld_dir)
else
ifeq ($(pwre_lang),en_us)
lang := en
endif
ifeq ($(pwre_lang),sv_se)
lang := sw
pwr_lang := 1
endif
lang_hw_source := $(pwre_sroot)/$(type_name)/$(comp_name)/$(pwre_lang)/$(os_name)/$(hw_name)
lang_os_source := $(pwre_sroot)/$(type_name)/$(comp_name)/$(pwre_lang)/$(os_name)
lang_co_source := $(pwre_sroot)/$(type_name)/$(comp_name)/$(pwre_lang)
lang_dir := $(exe_dir)/$(pwre_lang)
lang_bld_dir := $(bld_dir)/$(pwre_lang)
endif
source = $<
sname = $(notdir $(basename $<))
ssuff = $(suffix $<)
sdir = $(dir $<)/
target = $@
tname = $(notdir $(basename $@))
tsuff = $(suffix $@)
tdir = $(dir $@)/
libobj = $(bld_dir)/$*$(obj_ext)
cobj = -c -o $(target)
clibobj = -c -o $(libobj)
rt_msg_objs := $(obj_dir)/pwr_msg_co.o $(obj_dir)/pwr_msg_rt.o
rs_msg_objs := $(obj_dir)/pwr_msg_rs.o
wb_msg_objs := $(obj_dir)/pwr_msg_wb.o $(obj_dir)/pwr_msg_ge.o $(obj_dir)/pwr_msg_flow.o
rt_msg_eobjs := $(eobj_dir)/pwr_msg_co.o $(eobj_dir)/pwr_msg_rt.o
rs_msg_eobjs := $(eobj_dir)/pwr_msg_rs.o
wb_msg_eobjs := $(eobj_dir)/pwr_msg_wb.o $(eobj_dir)/pwr_msg_ge.o $(eobj_dir)/pwr_msg_flow.o
# Configuration
#ifeq ($(pwre_conf_mysql),1)
# cmysql := -DPWRE_CONF_MYSQL=1
# linkmysql := -L/usr/lib/mysql -lmysqlclient
#else
# cmysql :=
# linkmysql :=
#endif
#ifeq ($(pwre_conf_gtk),1)
# cgtk := -DPWRE_CONF_GTK=1
# linkgtk := `pkg-config --libs gtk+-2.0`
#else
# cgtk :=
# linkgtk :=
#endif
#ifeq ($(pwre_conf_libusb),1)
# clibusb := -DPWRE_CONF_LIBUSB=1
# linklibusb := -lusb-1.0
#else
# clibusb :=
# linklibusb :=
#endif
log_done =
#csetos := -DOS_LINUX=1 -DOS=linux -D_LINUX -DHW_X86=1 -DHW=x86
#cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \
`pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) $(cgtk) $(clibusb)
csetos := $(pwre_conf_cc_define)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk)
rm := rm
cp := cp
cpflags :=
arflags := r
obj := -c -o $(target)
lex := flex
javac := javac
ifdef pwre_ar
ar := $(pwre_ar)
else
ar := ar
endif
ifdef pwre_cc
cc := $(pwre_cc)
ld := $(pwre_cc)
else
cc := gcc
ld := gcc
endif
ifdef pwre_cxx
cxx := $(pwre_cxx)
ldxx := $(pwre_cxx)
else
cxx := g++
ldxx := g++
endif
ifdef pwre_host_exe
tools_msg2cmsg := $(pwre_host_exe)/tools_msg2cmsg
tools_cmsg2c := $(pwre_host_exe)/tools_cmsg2c
tools_pdrgen := $(pwre_host_exe)/tools_pdrgen
wb_rtt := $(pwre_host_exe)/wb_rtt
co_convert := $(pwre_host_exe)/co_convert
co_merge := $(pwre_host_exe)/co_merge
else
tools_msg2cmsg := $(eexe_dir)/tools_msg2cmsg
tools_cmsg2c := $(eexe_dir)/tools_cmsg2c
tools_pdrgen := $(eexe_dir)/tools_pdrgen
wb_rtt := $(eexe_dir)/wb_rtt
co_convert := $(eexe_dir)/co_convert
co_merge := $(eexe_dir)/co_merge
endif
#docbook-related, added by jonas_h 2006-04-nn
#xsltproc := xsltproc
#fop := fop
#above is a symlink from /usr/local/bin/fop -> /usr/local/fop-0.92beta/fop
#xsltproc_args := --xinclude
#chunk_args_en_us = --stringparam root.filename $(basename $(notdir $(target))) --stringparam base.dir $(doc_dir)/en_us/
#chunk_args_sv_se = --stringparam root.filename $(basename $(notdir $(target))) --stringparam base.dir $(doc_dir)/sv_se/
#pwr_stylesheetdir = $(pwre_sroot)/doc/man/src
#docbook_stylesheetdir = /usr/local/share/xml/docbook/stylesheet/snapshot
#html_xsl = $(pwr_stylesheetdir)/pwrxsl-html.xsl
#chunk_xsl = $(pwr_stylesheetdir)/pwrxsl-chunk.xsl
#fo_xsl = $(pwr_stylesheetdir)/pwrxsl-fo.xsl
#end of
#list = $(to-vms $(lis_dir)/$(sname)$(lis_ext))
map = $(bld_dir)/$(tname)$(map_ext)
mkdir := mkdir
# Set to /buildversion for frozen dbs versions
wblflags :=
ifeq ($(pwre_btype),rls)
cflags := -c -O3 -D_GNU_SOURCE -DPWR_NDEBUG -D_REENTRANT -fPIC
cxxflags := $(cflags)
linkflags := -O3 -L$(lib_dir)
elinkflags := -O3 -L$(lib_dir) -L$(elib_dir)
explinkflags := -g -L$(elib_dir)
clis = /lis=$(list)
dolist = /lis=$(list)
domap =
else
cflags := -c -g -Wall -D_GNU_SOURCE -D_REENTRANT -fPIC
cxxflags := $(cflags) -Wno-deprecated
mmflags := -Wno-deprecated
linkflags := -g -L$(lib_dir) $(pwre_conf_libdir)
elinkflags := -g -L$(lib_dir) -L$(elib_dir) $(pwre_conf_libdir)
explinkflags := -g -L$(elib_dir) $(pwre_conf_libdir)
dolist = /lis=$(list)
clis :=
domap =
endif
log_h_h = echo "Exporting $<"
log_x_h = echo "Exporting $< to $(notdir $@)"
log_l_obj = echo "Compiling $<"
log_l_lib = echo "Compiling $(notdir $(basename $@))($<)"
#log_c_d = echo "Updating dependencies $<"
log_c_obj = echo "Compiling $<"
log_c_lib = echo "Compiling $(notdir $(basename $@))($<)"
log_x_lib = echo "Compiling $(notdir $(basename $@))($<)"
log_obj_lib = echo "Archiving lasse $(notdir $(basename $@))($(notdir $<))"
log_hlp_hlb = echo "Exporting $(notdir $(basename $@))($<)"
log_sc_lib = echo "Compiling $(notdir $(basename $@))($<)"
log_sc_obj = echo "Compiling $<"
log_uil_uid = echo "Compiling $<"
log_g_m1 = echo "Exporting $<"
log_cld_lib = echo "Compiling $(notdir $(basename $@))($<)"
log_link_exe = echo "Linking $@"
log_wb_load_wb_vers = echo "Exporting $<"
log_xbm_xbm = echo "Exporting $<"
log_frm_frm = echo "Exporting $<"
log_graph_graph = echo "Exporting $<"
log_msg_h = echo "Compiling $<"
log_java_class = echo "Compiling $<"
endif
# lib_generic.mk -- generic makefile for libraries
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# To build a library.
#
ifndef jpwr_generic_mk
jpwr_generic_mk := 1
ifndef variables_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.java $(hw_source):$(os_source):$(co_source)
vpath %.gif $(hw_source):$(os_source):$(co_source)
vpath %.png $(hw_source):$(os_source):$(co_source)
#VPATH = $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source)
java_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.java) \
), $(notdir $(file)) \
) \
)
gif_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.gif) \
), $(notdir $(file)) \
) \
)
gif_exe_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)_*.gif) \
), $(notdir $(file)) \
) \
)
png_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.png) \
), $(notdir $(file)) \
) \
)
png_exe_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)_*.png) \
), $(notdir $(file)) \
) \
)
jpwr_name := pwr_$(comp_name)
export_lib := $(lib_dir)/$(jpwr_name).jar
java_classes := $(addsuffix .class, $(basename $(local_java_sources)))
gif_objects := $(addprefix $(bld_dir)/, $(gif_sources))
gif_exe_objects := $(addprefix $(exe_dir)/, $(gif_exe_sources))
png_objects := $(addprefix $(bld_dir)/, $(png_sources))
png_exe_objects := $(addprefix $(exe_dir)/, $(png_exe_sources))
java_objects := $(addprefix $(bld_dir)/, $(java_classes))
objects := $(gif_objects) $(gif_exe_objects) $(png_objects) $(png_exe_objects) $(java_objects)
source_dependencies := $(notdir $(basename $(sources)))
source_dependencies := $(addprefix $(bld_dir)/, $(source_dependencies))
source_dependencies := $(addsuffix $(d_ext), $(source_dependencies))
.PHONY : all init copy lib exe clean realclean \
dirs clean_includes \
clean_bld clean_dirs clean_lib
# dirs $(clean_h_includes) $(clean_hpp_includes)
all : init copy lib exe
init : dirs
copy :
lib : $(export_lib)
exe :
dirs : $(bld_dir)$(dir_ext)
$(bld_dir)$(dir_ext) :
@ $(mkdir) $(mkdirflags) $(basename $@)/
clean : clean_bld clean_lib
realclean : clean clean_includes clean_dirs
clean_bld :
@ echo "Cleaning build directory"
@ $(rm) $(rmflags) $(bld_dir)/*
clean_dirs :
@ echo "Removing build directory"
@ $(rm) -r $(rmflags) $(bld_dir)
clean_lib :
@ echo "Removing archive $(notdir $(export_lib))"
@ $(rm) $(rmflags) $(export_lib)
clean_includes : $(clean_h_includes) $(clean_hpp_includes)
$(clean_h_includes) : clean_%.h : %.h
@ echo "Removing h-includes"
@ $(rm) $(rmflags) $(inc_dir)/$*.h
$(clean_hpp_includes) : clean_%.hpp : %.hpp
@ echo "Removing hpp-includes"
@ $(rm) $(rmflags) $(inc_dir)/$*.hpp
$(export_lib) : $(objects)
@ echo "Building archive $(notdir $(export_lib))"
@ if [ -e $(export_lib) ]; then \
$(rm) $(export_lib); \
fi
@ cd $(pwre_broot)/$(pwre_target)/bld; \
echo "Inserting png and gif files"; \
jar cf $(export_lib) jpwr/$(comp_name)/*.gif; \
jar uf $(export_lib) jpwr/$(comp_name)/*.png; \
find jpwr/$(comp_name) -name "*.class" -exec jar uf $(export_lib) {} \;;
# @ jar cvfm $(export_lib) ../../manifest.stub jpwr/$(comp_name)/*.class jpwr/$(comp_name)/*.gif
#-include $(source_dependencies)
endif
# lib_generic.mk -- generic makefile for libraries
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# To build a library.
#
ifndef lib_generic_mk
lib_generic_mk := 1
ifndef variables_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif
source_dirs = $(hw_source) $(os_source) $(co_source)
-include ../../lib_local.mk
-include ../lib_local.mk
-include lib_local.mk
vpath %.h $(hw_source):$(os_source):$(co_source)
vpath %.hpp $(hw_source):$(os_source):$(co_source)
vpath %.c $(hw_source):$(os_source):$(co_source)
vpath %.cpp $(hw_source):$(os_source):$(co_source)
vpath %.x $(hw_source):$(os_source):$(co_source)
vpath %.pdr $(hw_source):$(os_source):$(co_source)
vpath %.java $(hw_source):$(os_source):$(co_source)
vpath %.pwsg $(hw_source):$(os_source):$(co_source)
vpath %.meth $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source)
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.c $(dir)/$(comp_name)*.cpp) \
), $(notdir $(file)) \
) \
)
h_includes := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.h) \
), $(notdir $(file)) \
) \
)
hpp_includes := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.hpp) \
), $(notdir $(file)) \
) \
)
xdr_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.x) \
), $(notdir $(file)) \
) \
)
pdr_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.pdr) \
), $(notdir $(file)) \
) \
)
java_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.java) \
), $(notdir $(file)) \
) \
)
pwsg_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.pwsg) \
), $(notdir $(file)) \
) \
)
meth_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.meth) \
), $(notdir $(file)) \
) \
)
xdr_includes := $(addprefix $(inc_dir)/,$(patsubst %.x, %.h, $(xdr_sources)))
xdr_objects := $(patsubst %.x, %_xdr.o, $(xdr_sources))
pdr_includes := $(addprefix $(inc_dir)/,$(patsubst %.pdr, %.h, $(pdr_sources)))
pdr_objects := $(patsubst %.pdr, %_pdr.o, $(pdr_sources))
export_includes := $(addprefix $(inc_dir)/,$(h_includes) $(hpp_includes))
export_includes += $(xdr_includes) $(pdr_includes)
export_pwsg := $(addprefix $(exe_dir)/,$(pwsg_sources))
export_meth := $(addprefix $(inc_dir)/,$(meth_sources))
clean_h_includes := $(patsubst %.h,clean_%.h, $(h_includes))
clean_hpp_includes := $(patsubst %.hpp,clean_%.hpp, $(hpp_includes))
lib_name := libpwr_$(comp_name)
ifneq ($(src_name),src)
lib_name := libpwr_$(comp_name)_$(src_name)
endif
export_lib := $(lib_dir)/$(lib_name)$(lib_ext)
java_classes := $(addsuffix .class, $(basename $(java_sources)))
objects := $(addsuffix $(obj_ext), $(basename $(sources)))
objects += $(xdr_objects) $(pdr_objects)
objects += $(java_classes)
objects := $(addprefix $(bld_dir)/, $(objects))
source_dependencies := $(notdir $(basename $(sources) $(pdr_objects) $(xdr_objects)))
source_dependencies := $(addprefix $(bld_dir)/, $(source_dependencies))
source_dependencies := $(addsuffix $(d_ext), $(source_dependencies))
.PHONY : all init copy lib exe $(l_copy) clean realclean \
dirs clean_includes \
clean_bld clean_dirs clean_lib $(l_clean_copy)
# dirs $(clean_h_includes) $(clean_hpp_includes)
all : init copy lib exe
init : dirs
copy : $(export_includes) $(l_copy) $(export_pwsg) $(export_meth)
lib : $(export_lib)
exe :
echo:
echo $(source_dependencies)
dirs : $(bld_dir)$(dir_ext)
$(bld_dir)$(dir_ext) :
@ $(mkdir) $(mkdirflags) $(basename $@)/
clean : clean_bld clean_lib
clean_copy: $(l_clean_copy)
realclean : clean clean_includes clean_pwsg clean_dirs
clean_bld :
@ echo "Cleaning build directory"
@ $(rm) $(rmflags) $(bld_dir)/*
clean_dirs :
@ echo "Removing build directory"
@ $(rm) -r $(rmflags) $(bld_dir)
clean_lib :
@if [ -e $(export_lib) ]; then \
echo "Removing archive $(notdir $(export_lib))" \
$(rm) $(export_lib); \
fi
clean_includes : $(clean_h_includes) $(clean_hpp_includes)
$(clean_h_includes) : clean_%.h : %.h
@ echo "Removing h-include: $(inc_dir)/$*.h"
@ $(rm) $(rmflags) $(inc_dir)/$*.h
$(clean_hpp_includes) : clean_%.hpp : %.hpp
@ echo "Removing hpp-include: $(inc_dir)/$*.hpp"
@ $(rm) $(rmflags) $(inc_dir)/$*.hpp
$(clean_pwsg) : clean_%.pwsg : %.pwsg
@ echo "Removing pwsg: $(exe_dir)/$*.pwsg"
@ $(rm) $(rmflags) $(exe_dir)/$*.pwsg
$(export_lib) : $(objects)
@ echo "Building archive $(notdir $(export_lib))"
@ if [ "$(objects)" != "" ]; then \
$(ar) -cr $(export_lib) $(objects); \
fi
# @ if [ -e $(export_lib) ]; then \
# $(rm) $(export_lib); \
# fi
-include $(source_dependencies)
endif
ifndef link_rule_mk
link_rule_mk := 1
link = $(ld) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs) \
$(pwre_conf_libpwrrt) $(pwre_conf_lib)
endif
# mmi_generic.mk -- generic make file for building mmi components
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# <Description>
#
ifndef mmi_generic_mk
mmi_generic_mk := 1
ifndef variables_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.uil $(hw_source):$(os_source):$(co_source)
vpath %.pwg $(hw_source):$(os_source):$(co_source)
vpath %.pwsg $(hw_source):$(os_source):$(co_source)
vpath %.png $(hw_source):$(os_source):$(co_source)
source_dirs := $(hw_source) $(os_source) $(co_source)
uil_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.uil) \
), $(notdir $(file)) \
) \
)
pwg_c_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/pwr_c_*.pwg) \
), $(notdir $(file)) \
) \
)
pwg_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.pwg) \
), $(notdir $(file)) \
) \
)
pwsg_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.pwsg) \
), $(notdir $(file)) \
) \
)
png_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.png) \
), $(notdir $(file)) \
) \
)
export_uid := $(addprefix $(exe_dir)/, $(patsubst %.uil, %.uid, $(uil_sources)))
export_c_pwg := $(addprefix $(exe_dir)/, $(pwg_c_sources))
export_pwg := $(addprefix $(exe_dir)/, $(pwg_sources))
export_pwsg := $(addprefix $(exe_dir)/, $(pwsg_sources))
export_png := $(addprefix $(exe_dir)/, $(png_sources))
$(exe_dir)/%.uid : %.uil
@ $(log_uil_uid)
@ export LANG; uil -o $(target) $(source)
clean_uid := $(patsubst %.uil,clean_%.uid,$(uil_sources))
clean_c_pwg := $(patsubst %.pwg,clean_%.pwg,$(pwg_c_sources))
clean_pwg := $(patsubst %.pwg,clean_%.pwg,$(pwg_sources))
clean_pwsg := $(patsubst %.pwsg,clean_%.pwsg,$(pwsg_sources))
clean_png := $(patsubst %.png,clean_%.png,$(png_sources))
.PHONY : all init copy lib exe clean realclean\
dirs clean_bld clean_dirs $(clean_uid)
all : init copy
init : dirs
copy : $(export_uid) $(export_c_pwg) $(export_pwg) $(export_pwsg) $(export_png)
lib :
exe :
clean : $(clean_uid) $(clean_pwg) $(clean_pwsg) $(clean_png)
realclean : clean
dirs :
$(clean_uid) : clean_%.uid : %.uil
@ echo "Removing uid"
@ $(rm) $(rmflags) $(exe_dir)/$*.uid
$(clean_pwg) : clean_%.pwg : %.pwg
@ echo "Removing pwg"
@ $(rm) $(rmflags) $(exe_dir)/$*.pwg
$(clean_c_pwg) : clean_%.pwg : %.pwg
@ echo "Removing pwg"
@ $(rm) $(rmflags) $(exe_dir)/$*.pwg
$(clean_pwsg) : clean_%.pwsg : %.pwsg
@ echo "Removing pwsg"
@ $(rm) $(rmflags) $(exe_dir)/$*.pwsg
$(clean_png) : clean_%.png : %.png
@ echo "Removing png"
@ $(rm) $(rmflags) $(exe_dir)/$*.png
endif
# msg_generic.mk -- generic makefile for messages
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# To build a message file.
#
ifndef msg_generic_mk
msg_generic_mk := 1
ifndef variables_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.msg $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source)
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.msg) \
), $(notdir $(file)) \
) \
)
export_includes := $(addprefix $(inc_dir)/, $(patsubst %.msg, %.h, $(sources)))
clean_includes := $(patsubst %.msg, clean_%.h, $(sources))
cmsgs := $(addprefix $(bld_dir)/,$(basename $(sources)))
cmsgs := $(strip $(addsuffix .cmsg,$(cmsgs)))
export_cmsg = $(obj_dir)/pwr_msg_$(comp_name).cmsg
export_obj = $(obj_dir)/pwr_msg_$(comp_name)$(obj_ext)
.PHONY : all init copy lib exe clean realclean\
dirs $(clean_includes) clean_lib clean_obj clean_dirs
all : init copy lib
init : dirs
copy : $(export_includes) $(export_cmsg)
lib : $(export_obj)
exe :
dirs : $(bld_dir)$(dir_ext)
$(bld_dir)$(dir_ext) :
$(mkdir) $(mkdirflags) $(basename $@)
clean :
realclean : $(clean_includes) clean_obj clean_dirs
$(export_cmsg) : $(cmsgs)
@ echo Creating: obj_dir/$(notdir $@)
@ cat $(cmsgs) > $(export_cmsg)
$(export_obj) : $(export_cmsg)
clean_lib :
@ $(rm) $(rmflags) $(export_lib)
clean_obj :
@ $(rm) $(rmflags) $(export_obj)
$(clean_includes) : clean_%.h : %.msg
@ $(rm) $(rmflags) $(inc_dir)/$*.h
clean_dirs :
@ $(rmdir) $(rmdirflags) $(bld_dir)
endif
# rules.mk -- rules common for all makefiles
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# <Description>
#
ifndef rules_mk
rules_mk := 1
ifndef variables_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/variables.mk
endif
.SUFFIXES:
$(bld_dir)/%.cmsg $(inc_dir)/%.h: %.msg
@ $(log_msg_h)
@ $(tools_msg2cmsg) $(source) $(bld_dir)/$(tname).cmsg $(inc_dir)/$(tname).h
$(obj_dir)/%.cmsg $(inc_dir)/%.h : %.msg
@ $(log_msg_h)
@ $(tools_msg2cmsg) $(source) $(obj_dir)/$(tname).cmsg $(inc_dir)/$(tname).h
$(obj_dir)/%.o : $(obj_dir)/%.cmsg
@ $(log_cmsg_obj)
@ $(tools_cmsg2c) -b $(comp_name) $(source) $(tmp_dir)/$(sname).c
@ $(cc) $(cflags) $(csetos) $(cinc) $(cobj) $(tmp_dir)/$(sname).c
$(bld_dir)/%.c : %.l
@ $(log_l_obj)
@ $(lex) -o$(bld_dir)/$(sname).c $(source)
%.o : %.c
@ echo "Warning, rule shall normally not be used: %.o : %.c"
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cc) -MM $(cinc) $(csetos) $(source) \
| sed '\''s|$(notdir $*)\.o[ ]*|$(bld_dir)/&|g'\'' > $(bld_dir)/$(sname).d'
endif
@ $(log_c_obj)
@ $(cc) $(cflags) $(csetos) $(cinc) $(cobj) $(source)
(%.o) : %.c
@ echo "Error, rule shall not be used: (%.o) : %.c"
$(bld_dir)/%.o : %.c
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cc) -MM $(cinc) $(csetos) $(source) \
| sed '\''s|$*\.o[ ]*|$(bld_dir)/&|g'\'' > $(bld_dir)/$(sname).d'
endif
@ $(log_c_obj)
@ $(cc) $(cflags) $(csetos) $(cinc) $(cobj) $(source)
$(bld_dir)/%.o : $(tmp_dir)/%.c
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cc) -MM $(cinc) $(csetos) $(source) \
| sed '\''s|$*\.o[ ]*|$(bld_dir)/&|g'\'' > $(bld_dir)/$(sname).d'
endif
@ $(log_c_obj)
@ $(cc) $(cflags) $(csetos) $(cinc) $(cobj) $(source)
$(obj_dir)/%.o : %.c
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cc) -MM $(cinc) $(csetos) $(source) \
| sed '\''s|$*\.o[ ]*|$(obj_dir)/&|g'\'' > $(obj_dir)/$(sname).d'
endif
@ $(log_c_obj)
@ $(cc) $(cflags) $(csetos) $(cinc) $(cobj) $(source)
%.o : %.cpp
@ echo "Error, rule shall not be used: %.o : %.cpp"
(%.o) : %.cpp
@ echo "Error, rule shall not be used: (%.o) : %.cpp"
$(bld_dir)/%.o : %.cpp
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cxx) -MM $(csetos) $(mmflags) $(cinc) $(source) \
| sed '\''s|$*\.o[ ]*|$(bld_dir)/&|g'\'' > $(bld_dir)/$(sname).d'
endif
@ $(log_c_obj)
@ $(cxx) $(cxxflags) $(csetos) $(cinc) $(cobj) $(source)
$(bld_dir)/%.o : $(tmp_dir)/%.cpp
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cxx) -MM $(cinc) $(csetos) $(mmflags) $(source) \
| sed '\''s|$*\.o[ ]*|$(bld_dir)/&|g'\'' > $(bld_dir)/$(sname).d'
endif
@ $(log_c_obj)
@ $(cxx) $(cxxflags) $(csetos) $(cinc) $(cobj) $(source)
$(obj_dir)/%.o : %.cpp
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cxx) -MM $(cinc) $(csetos) $(mmflags) $(source) \
| sed '\''s|$*\.o[ ]*|$(obj_dir)/&|g'\'' > $(obj_dir)/$(sname).d'
endif
@ $(log_c_obj)
@ $(cxx) $(cxxflags) $(csetos) $(cinc) $(cobj) $(source)
$(inc_dir)/%.h : %.x
@ $(log_x_h)
@ if [ -e $(target) ]; then \
$(rm) $(target); \
fi
@ rpcgen -h -o $(target) $(source)
$(bld_dir)/%_xdr.o : %.x
@ $(log_x_lib)
@ rpcgen -c -o $(bld_dir)/$(sname)_xdr.t $(source)
@ sed 's/\(#include "\)\(.*$(sname)[^"]*\)/\1$(sname).h/' $(bld_dir)/$(sname)_xdr.t \
| grep -v "register int32_t \*buf\;"> $(bld_dir)/$(sname)_xdr.c
@ rm $(bld_dir)/$(sname)_xdr.t
ifeq ($(nodep),)
@ $(SHELL) -ec '$(cc) -MM $(cinc) $(csetos) $(bld_dir)/$(sname)_xdr.c \
| sed '\''s|$*_xdr\.o[ ]*|$(bld_dir)/&|g'\'' \
| sed '\''s|$(bld_dir)/$(sname)_xdr.c||'\'' > $(bld_dir)/$(sname)_xdr.d'
endif
@ $(cc) $(cflags) $(csetos) $(cinc) -c -o $(bld_dir)/$(sname)_xdr.o $(bld_dir)/$(sname)_xdr.c
@ mv $(bld_dir)/$(sname)_xdr.c $(bld_dir)/$(sname)_xdr_compiled.c
$(inc_dir)/%.h : %.pdr
@ $(log_x_h)
@ if [ -e $(target) ]; then \
$(rm) $(target); \
fi
@ $(tools_pdrgen) -h -o $(target) $(source)
$(bld_dir)/%_pdr.o : %.pdr
@ $(log_x_lib)
@ $(tools_pdrgen) -c -o $(bld_dir)/$(sname)_pdr.c $(source)
ifeq ($(nodep),)
@ $(SHELL) -ec '$(cc) -MM $(cinc) $(csetos) $(bld_dir)/$(sname)_pdr.c \
| sed '\''s|$*_pdr\.o[ ]*|$(bld_dir)/&|g'\'' \
| sed '\''s|$(bld_dir)/$(sname)_pdr.c||'\'' > $(bld_dir)/$(sname)_pdr.d'
endif
@ $(cc) $(cflags) $(csetos) $(cinc) -c -o $(bld_dir)/$(sname)_pdr.o $(bld_dir)/$(sname)_pdr.c
@ mv $(bld_dir)/$(sname)_pdr.c $(bld_dir)/$(sname)_pdr_compiled.c
(%.o) : %.o
@ echo "Error, rule shall not be used: (%.o) : %.o"
$(inc_dir)/%.h : %.h
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
@ chmod u+w $(target)
$(inc_dir)/%.hpp : %.hpp
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
@ chmod u+w $(target)
%.class : %.java
@ echo "Warning, rule shall not be used: %.class : %.java"
$(bld_dir)/%.class : %.java
@ $(log_java_class)
@ $(javac) -encoding Latin1 -d $(pwre_broot)/$(pwre_target)/bld $(source)
# @ $(javac) -Xlint:unchecked,deprecation -d $(pwre_broot)/$(pwre_target)/bld $(source)
$(bld_dir)/%.gif : %.gif
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/%.gif : %.gif
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(doc_dir)/orm/%.gif : %.gif
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(doc_dir)/%.gif : %.gif
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(doc_dir)/sv_se/%.gif : %.gif
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(cnf_dir)/%.wb_vers : %.wb_load
@ $(log_wb_load_wb_vers)
@ wb_load $(source) $(lis_dir)/$(tname).wb_list
@ $(pwre_sroot)/tools/com/src/$(os_name)/$(hw_name)/pwr_show_version.sh $(source) $(target)
$(exe_dir)/%.pwsg : %.pwsg
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/%.pwg : %.pwg
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(bld_dir)/%.png : %.png
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/%.png : %.png
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/%.html : ../../%.html
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(doc_dir)/%.html : ../../%.html
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(inc_dir)/%.meth : %.meth
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
endif
# wbl_generic.mk -- generic make file for building wbl components
#
# PROVIEW/R
# Copyright (C) 1996 by Comator Process AB.
#
# <Description>
#
ifndef wbl_generic_mk
wbl_generic_mk := 1
ifndef variables_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_kroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.wb_load $(hw_source):$(os_source):$(co_source)
source_dirs := $(hw_source) $(os_source) $(co_source)
wblsources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.wb_load) \
), $(notdir $(file)) \
) \
)
flwsources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.flw) \
), $(notdir $(file)) \
) \
)
pdfsources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.pdf) \
), $(notdir $(file)) \
) \
)
wbl_sources := $(filter %.wb_load,$(wblsources))
flw_sources := $(filter %.flw,$(flwsources))
pdf_sources := $(filter %.pdf,$(pdfsources))
export_wbl := $(addprefix $(load_dir)/, $(patsubst %.wb_load, %.dbs, $(wbl_sources)))
export_flw := $(patsubst %.flw,$(load_dir)/%.flw,$(flw_sources))
export_pdf_en_us := $(patsubst %.pdf,$(doc_dir)/en_us/orm/%.pdf,$(pdf_sources))
export_pdf_sv_se := $(patsubst %.pdf,$(doc_dir)/sv_se/orm/%.pdf,$(pdf_sources))
export_wbl_dbs := $(patsubst %.wb_load,$(load_dir)/%.dbs,$(wbl_sources))
export_wbl_h := $(patsubst %.wb_load,$(inc_dir)/pwr_%classes.h,$(wbl_sources))
export_wbl_hpp := $(patsubst %.wb_load,$(inc_dir)/pwr_%classes.hpp,$(wbl_sources))
export_wbl_xtthelp_en_us := $(patsubst %.wb_load,$(exe_dir)/en_us/%_xtthelp.dat,$(wbl_sources))
export_wbl_xtthelp_sv_se := $(patsubst %.wb_load,$(exe_dir)/sv_se/%_xtthelp.dat,$(wbl_sources))
export_wbl_html_en_us := $(patsubst %.wb_load,$(doc_dir)/en_us/orm/%_allclasses.html,$(wbl_sources))
export_wbl_html_sv_se := $(patsubst %.wb_load,$(doc_dir)/sv_se/orm/%_allclasses.html,$(wbl_sources))
export_wbl_ps_en_us := $(patsubst %.wb_load,$(doc_dir)/en_us/%.ps,$(wbl_sources))
export_wbl_ps_sv_se := $(patsubst %.wb_load,$(doc_dir)/sv_se/%.ps,$(wbl_sources))
clean_dbs := $(patsubst %.wb_load,clean_%.dbs,$(wbl_sources))
clean_h := $(patsubst %.wb_load,clean_%.h,$(wbl_sources))
clean_hpp := $(patsubst %.wb_load,clean_%.hpp,$(wbl_sources))
clean_xtthelp_sv_se := $(patsubst %.wb_load,clean_%_sv_se.xtthelp,$(wbl_sources))
clean_xtthelp_en_us := $(patsubst %.wb_load,clean_%_en_us.xtthelp,$(wbl_sources))
clean_html_sv_se := $(patsubst %.wb_load,clean_%_sv_se.html,$(wbl_sources))
clean_html_en_us := $(patsubst %.wb_load,clean_%_en_us.html,$(wbl_sources))
clean_ps_sv_se := $(patsubst %.wb_load,clean_%_sv_se.ps,$(wbl_sources))
clean_ps_en_us := $(patsubst %.wb_load,clean_%_en_us.ps,$(wbl_sources))
.SUFFIXES:
$(load_dir)/%.dbs : ../../%.wb_load
@ echo "Generating loadfile for $(source)"
@ export pwr_load=$(pwr_eload);\
wb_cmd -q -i create snapshot $(wblflags) /file=\"$(source)\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_%classes.h : ../../%.wb_load
@ echo "Generating struct files for $(source) classes..."
@ $(co_convert) -so -d $(inc_dir) "$(source)"
$(inc_dir)/pwr_%classes.hpp : ../../%.wb_load
@ echo "Generating hpp files for $(source) classes..."
@ $(co_convert) -po -d $(inc_dir) "$(source)"
$(doc_dir)/en_us/orm/%.pdf : ../../%.pdf
@ echo "Copy en_us $(source)"
@ $(cp) $(cpflags) $(source) $(target)
$(doc_dir)/sv_se/orm/%.pdf : ../../%.pdf
@ echo "Copy sv_se $(source)"
@ $(cp) $(cpflags) $(source) $(target)
$(doc_dir)/en_us/orm/%_allclasses.html : ../../%.wb_load
@ echo "Generating html files for $(source) classes en_us..."
@ $(co_convert) -w -d $(doc_dir)/en_us/orm -g $(pwre_sroot)/wbl/mcomp/src/cnv_setup.dat "$(source)"
@ $(co_convert) -c -d $(doc_dir)/en_us/orm $(inc_dir)/pwr_$(pwre_module)classes.h
@ $(co_convert) -c -d $(doc_dir)/en_us/orm $(inc_dir)/pwr_$(pwre_module)classes.hpp
@ $(co_convert) -k -d $(doc_dir)/en_us/orm -l en_us
$(doc_dir)/sv_se/orm/%_allclasses.html : ../../%.wb_load
@ echo "Generating html files for $(source) classes sv_se..."
@ $(co_convert) -w -l sv_se -d $(doc_dir)/sv_se/orm -g $(pwre_sroot)/wbl/mcomp/src/cnv_setup.dat "$(source)"
@ $(co_convert) -c -d $(doc_dir)/sv_se/orm $(inc_dir)/pwr_$(pwre_module)classes.h
@ $(co_convert) -c -d $(doc_dir)/sv_se/orm $(inc_dir)/pwr_$(pwre_module)classes.hpp
@ $(co_convert) -k -d $(doc_dir)/sv_se/orm -l sv_se
$(doc_dir)/en_us/%.ps : ../../%.wb_load
@ echo "Generating postscript file for $(source) classes en_us..."
@ $(co_convert) -q -l en_us -d $(doc_dir)/en_us "$(source)"
$(doc_dir)/sv_se/%.ps : ../../%.wb_load
@ echo "Generating postscript file for $(source) classes sv_se..."
@ $(co_convert) -q -l sv_se -d $(doc_dir)/sv_se "$(source)"
$(exe_dir)/en_us/%_xtthelp.dat : ../../%.wb_load
@ echo "Generating xtt help files for $(source) classes en_us"
@ $(co_convert) -x -d $(exe_dir)/en_us "$(source)"
$(exe_dir)/sv_se/%_xtthelp.dat : ../../%.wb_load
@ echo "Generating xtt help files for $(source) classes sv_se"
@ $(co_convert) -x -l sv_se -d $(exe_dir)/sv_se "$(source)"
$(exe_dir)/%.pwg : ../../%.pwg
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/%.pwsg : ../../%.pwsg
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(load_dir)/%.flw : ../../%.flw
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
.PHONY : all init copy lib exe clean realclean\
$(clean_wbl)
all : init copy exe
init :
lib : $(export_wbl_dbs)
copy : $(export_wbl_h) \
$(export_wbl_hpp) \
$(export_pwg) \
$(export_pwsg) \
$(export_flw)
exe: $(export_wbl_xtthelp_en_us) \
$(export_wbl_xtthelp_sv_se) \
$(export_wbl_html_en_us) \
$(export_wbl_html_sv_se) \
$(export_wbl_ps_en_us) \
$(export_wbl_ps_sv_se) \
$(export_pdf_en_us) \
$(export_pdf_sv_se)
clean : \
$(clean_xtthelp_sv_se) $(clean_xtthelp_en_us) \
$(clean_html_sv_se) $(clean_html_en_us) \
$(clean_ps_sv_se) $(clean_ps_en_us)
realclean : clean \
$(clean_dbs) \
$(clean_h) \
$(clean_hpp) \
$(clean_dbs) : clean_%.dbs : $(load_dir)/%.dbs
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_h) : clean_%.h : $(inc_dir)/pwr_%classes.h
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_hpp) : clean_%.hpp : $(inc_dir)/pwr_%classes.hpp
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_ps_sv_se) : clean_%_sv_se.ps : $(doc_dir)/sv_se/%.ps
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_ps_en_us) : clean_%_en_us.ps : $(doc_dir)/en_us/%.ps
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_html_sv_se) : clean_%_sv_se.html : $(doc_dir)/sv_se/orm/%_allclasses.html
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_html_en_us) : clean_%_en_us.html : $(doc_dir)/en_us/orm/%_allclasses.html
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_xtthelp_sv_se) : clean_%_sv_se.xtthelp : $(exe_dir)/sv_se/%_xtthelp.dat
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
$(clean_xtthelp_en_us) : clean_%_en_us.xtthelp : $(exe_dir)/en_us/%_xtthelp.dat
@ echo "rm $(source)"
@ if [ -e $(source) ]; then \
$(rm) $(rmflags) $(source); \
fi
endif
# dir_symbols.mk - get directory symbols
#
#
#
comma := ,
empty :=
space := $(empty) $(empty)
pred_13 := 12
pred_12 := 11
pred_11 := 10
pred_10 := 9
pred_9 := 8
pred_8 := 7
pred_7 := 6
pred_6 := 5
pred_5 := 4
pred_4 := 3
pred_3 := 2
pred_2 := 1
pred_1 := 0
cwd_dirs := $(subst /,$(space),$(PWD))
cwd_dirs := $(subst .hw_,hw_,$(cwd_dirs))
cwd_dirs := $(subst .os_,os_,$(cwd_dirs))
word := $(words $(cwd_dirs))
hw_name := $(word $(word), $(cwd_dirs))
ifneq ($(findstring hw, $(hw_name)),hw)
include ___error___hw
endif
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
os_name := $(word $(word), $(cwd_dirs))
ifneq ($(findstring os,$(os_name)),os)
include ___error___os
endif
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
src_name := $(word $(word), $(cwd_dirs))
#ifneq ($(src_name),src)
#include ___error___no_source_subdirectory
#endif
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
comp_name := $(word $(word), $(cwd_dirs))
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
type_name := $(word $(word), $(cwd_dirs))
prev := pred_ $(word)
pred := $(subst $(space),$(empty),$(prev))
word := $($(pred))
root_name := $(word $(word), $(cwd_dirs))
#ifneq ($(src_name),src)
#include ___error___incorrect_source_root1
#endif
#rest = /$(type_name)/$(comp_name)/src/$(os_name)/$(hw_name)/
#test_source_root := $(subst $(rest),$(empty),$(PWD))
#ifneq ($(pwre_sroot),$(test_source_root))
#include ___error___incorrect_source_root2
#endif
bcomp 1
java 1
remote 1
nmps 1
sev 1
opc 1
profibus 1
otherio 1
ssabox 1
tlog 1
othermanu 1
abb 1
siemens 1
klocknermoeller 1
inor 1
telemecanique 1
\ No newline at end of file
#!/bin/bash
#
# Import loadfile
# Arg1 import base root
# Arg2 target base root
#
tst=`eval echo $1 | grep :`
if [ -z $tst ]; then
# Local import root, use cp
copy="cp"
else
# Remote import root, use scp
copy="scp"
fi
$copy $1/exp/load/*.dbs $2/exp/load/
cp -p $2/exp/load/pwrs.dbs $2/rt/load/
cp -p $2/exp/load/pwrb.dbs $2/rt/load/
cp -p $2/exp/load/rt.dbs $2/rt/load/
cp -p $2/exp/load/basecomponent.dbs $2/bcomp/load/
cp -p $2/exp/load/nmps.dbs $2/nmps/load/
cp -p $2/exp/load/opc.dbs $2/opc/load/
cp -p $2/exp/load/profibus.dbs $2/profibus/load/
cp -p $2/exp/load/otherio.dbs $2/otherio/load/
cp -p $2/exp/load/remote.dbs $2/remote/load/
cp -p $2/exp/load/tlog.dbs $2/tlog/load/
cp -p $2/exp/load/abb.dbs $2/abb/load/
cp -p $2/exp/load/inor.dbs $2/inor/load/
cp -p $2/exp/load/klocknermoeller.dbs $2/klocknermoeller/load/
cp -p $2/exp/load/othermanufacturer.dbs $2/othermanu/load/
cp -p $2/exp/load/siemens.dbs $2/siemens/load/
cp -p $2/exp/load/ssabox.dbs $2/ssabox/load/
cp -p $2/exp/load/telemecanique.dbs $2/telemecanique/load/
import_top : import_files
source = $<
target = $@
rt_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/pwrs.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/pwrb.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/rt.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/basecomponent.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/nmps.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/opc.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/profibus.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/otherio.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/remote.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/tlog.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/abb.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/inor.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/klocknermoeller.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/othermanufacturer.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/siemens.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/ssabox.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/telemecanique.dbs \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/rt/inc/pwr_systemclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/rt/inc/pwr_systemclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/rt/inc/pwr_baseclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/rt/inc/pwr_baseclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/bcomp/inc/pwr_basecomponentclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/bcomp/inc/pwr_basecomponentclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/nmps/inc/pwr_nmpsclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/nmps/inc/pwr_nmpsclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/opc/inc/pwr_opcclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/opc/inc/pwr_opcclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/profibus/inc/pwr_profibusclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/profibus/inc/pwr_profibusclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/otherio/inc/pwr_otherioclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/otherio/inc/pwr_otherioclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/remote/inc/pwr_remoteclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/remote/inc/pwr_remoteclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/abb/inc/pwr_abbclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/abb/inc/pwr_abbclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/inor/inc/pwr_inorclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/inor/inc/pwr_inorclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/klocknermoeller/inc/pwr_klocknermoellerclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/klocknermoeller/inc/pwr_klocknermoellerclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/othermanu/inc/pwr_othermanufacturerclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/othermanu/inc/pwr_othermanufacturerclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/siemens/inc/pwr_siemensclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/siemens/inc/pwr_siemensclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/ssabox/inc/pwr_ssaboxclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/ssabox/inc/pwr_ssaboxclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/telemecanique/inc/pwr_telemecaniqueclasses.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/telemecanique/inc/pwr_telemecaniqueclasses.hpp \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/exe/wb_gcg.sh \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_ldh.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_vext.h
op_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_wnav_selformat.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_nav.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_pal.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_palfile.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_wccm.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_log.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_trv.h
op_gtk_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_nav_gtk.h \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_log_gtk.h
op_motif_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_nav_motif.h
java_modules = \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/pwr_rt.jar \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/pwr_jop.jar \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/pwr_jopc.jar \
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/pwr_rt_client.jar
import_files : $(rt_modules) $(op_modules) $(java_modules) $(op_gtk_modules)
@ echo ""
.PHONY: rt
.PHONY: op
.PHONY: java
_gtk :
rt : $(rt_modules)
rt_gtk :
rt_motif :
op : $(op_modules)
op_gtk : $(op_gtk_modules)
op_motif : $(op_motif_modules)
java : $(java_modules)
java_gtk :
java_motif :
.SUFFIXES:
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/load/%.dbs : $(pwre_vmsinc)/exp/load/%.dbs
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/rt/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/rt/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/bcomp/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/bcomp/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/nmps/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/nmps/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/opc/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/opc/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/profibus/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/profibus/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/otherio/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/otherio/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/remote/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/remote/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/abb/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/abb/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/inor/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/inor/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/klocknermoeller/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/klocknermoeller/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/othermanu/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/othermanu/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/siemens/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/siemens/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/ssabox/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/ssabox/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/telemecanique/inc/%.h : $(pwre_vmsinc)/exp/inc/%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/telemecanique/inc/%.hpp : $(pwre_vmsinc)/exp/inc/%.hpp
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/exe/%.sh : $(pwre_vmsinc)/exp/exe/%.sh
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%_motif.h : $(pwre_croot)/wb/lib/wb/motif/wb_%_motif.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%_gtk.h : $(pwre_croot)/wb/lib/wb/gtk/wb_%_gtk.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/inc/wb_%.h : $(pwre_croot)/wb/lib/wb/src/wb_%.h
@ echo Import ${target}
@ cp $(source) $(target)
$(pwre_broot)/$(pwre_os)/$(pwre_hw)/exp/lib/%.jar : $(pwre_vmsinc)/exp/lib/%.jar
@ echo Import ${target}
@ cp $(source) $(target)
This diff is collapsed.
#!/bin/bash
#
# pwre.source
#
# This script must be sourced
#
# Only the init verb is handled by this script, all the others
# is handled by pwre.perl
#
#
# Don't call pwre.perl if it is the init verb
#
env="$2"
local cmd
cmd="help"
if [ -z $1 ] || [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
$pwre_bin/pwre.pl $@
return
fi
cmd="init"
if [ $1 = $cmd ]; then
echo "init..."
if [ "$env" = "" ]; then
echo "++ init what?"
else
export pwre_module=rt
export pwre_bmodule=rt
if $pwre_bin/pwre.pl _exists $2; then
set_env `$pwre_bin/pwre.pl _print $2`
else
echo "++ Environment $2 doesn't exist"
fi
source $pwre_bin/pwre_function
fi
return
fi
cmd="module"
if [ $1 = $cmd ]; then
echo "module..."
if [ -z $2 ]; then
export pwre_module="rt"
export pwre_bmodule="rt"
else
export pwre_module=$2
export pwre_bmodule=$2
fi
env=$pwre_env
set_env `$pwre_bin/pwre.pl _print $env`
return
fi
$pwre_bin/pwre.pl $@
#!/bin/bash
pwre_config_init()
{
d=`eval date +\"%F %X\"`
cat > $cfile <<EOF
#!/bin/bash
#
# pwre configuration file
#
# Generated by pwre_configure $d
# Do not edit this file
#
EOF
}
pwre_config_check_include()
{
echo -n "...Checking inc $1: "
let i=0
let found=0
let incfound=0
IFS=:
for file in $4
do
if test -e $file; then
echo "found"
echo "export PWRE_CONF_$2=1" >> $cfile
if test $3 == "1"; then
conf_cc_define=$conf_cc_define" -DPWRE_CONF_$2=1"
fi
incdir=${file%/*}
if test $incdir == "/usr/include"; then
incfound=1
else
while [ $i -lt $inc_cnt ]; do
if test ${inc_array[$i]} == $incdir; then
incfound=1
fi
i=$((i+1))
done
fi
if test $incfound -eq 0; then
inc_array[$inc_cnt]=$incdir
inc_cnt=$((inc_cnt+1))
fi
found=1
break
fi
done
if test $found -eq 0; then
echo "not found"
fi
}
pwre_config_check_lib()
{
echo -n "...Checking $1: "
let i=0
let found=0
let libfound=0
IFS=:
for file in $6
do
if test -e $file; then
echo "found"
echo "export PWRE_CONF_$2=1" >> $cfile
if test $5 == "1"; then
conf_cc_define=$conf_cc_define" -DPWRE_CONF_$2=1"
fi
if test $3 == "lib"; then
libdir=${file%/*}
if test $libdir == "/usr/lib"; then
libfound=1
else
while [ $i -lt $lib_cnt ]; do
if test ${lib_array[$i]} == $libdir; then
libfound=1
fi
i=$((i+1))
done
fi
if test $libfound -eq 0; then
lib_array[$lib_cnt]=$libdir
lib_cnt=$((lib_cnt+1))
fi
lib=${file##/*/lib}
if test $4 == "gtk"; then
conf_libgtk=$conf_libgtk" -l${lib%.*}"
elif test $4 == "motif"; then
conf_libmotif=$conf_libmotif" -l${lib%.*}"
else
conf_lib=$conf_lib" -l${lib%.*}"
fi
elif test $3 == "gtk"; then
conf_libgtk=$conf_libgtk" \\\`pkg-config --libs gtk+-2.0\\\`"
conf_incdirgtk=$conf_incdirgtk" \\\`pkg-config --cflags gtk+-2.0\\\`"
else
echo "Unknown type"
fi
found=1
break
fi
done
if test $found -eq 0; then
echo "not found"
echo "export PWRE_CONF_$2=0" >> $cfile
fi
}
pwre_create_blddir()
{
if test ! -e $pwre_croot/src/tools/bld/src/$pwre_os; then
cp -r $pwre_croot/src/tools/bld/src/os_templ $pwre_croot/src/tools/bld/src/$pwre_os
mv $pwre_croot/src/tools/bld/src/$pwre_os/hw_templ $pwre_croot/src/tools/bld/src/$pwre_os/$pwre_hw
elif test ! -e $pwre_croot/src/tools/bld/src/$pwre_os/$pwre_hw; then
cp -r $pwre_croot/src/tools/bld/src/os_templ/hw_templ $pwre_croot/src/tools/bld/src/$pwre_os/$pwre_hw
fi
}
pwre_create_makedir()
{
dirlist=`eval find $pwre_croot -name "os_templ"`
for dir in $dirlist; do
newdir=${dir%/*}/$pwre_os
if test ! -e $newdir; then
newdir=${dir%/*}/.$pwre_os
if test ! -e $newdir; then
echo "Creating $newdir"
cp -pr $dir $newdir
if test -e $newdir/hw_templ; then
mv $newdir/hw_templ $newdir/.$pwre_hw
fi
else
# os directory .os_ already exist
# Copy new and modified files
filelist=`eval ls $dir/`
for file in $filelist; do
if test ! -d $dir/$file; then
cp -p $dir/$file $newdir/
fi
done
if test -e $newdir/.$pwre_hw; then
cp -p $dir/hw_templ/* $newdir/.$pwre_hw/
elif test -e $dir/hw_templ; then
# Create hw dir
echo "Creating $newdir/$pwre_hw"
cp -pr $dir/hw_templ $newdir/.$pwre_hw
fi
fi
else
## os director os_ exist
if test ! -e $newdir/$pwre_hw; then
if test -e $newdir/.$pwre_hw; then
cp -p $dir/hw_templ/* $newdir/.$pwre_hw/
elif test -e $dir/hw_templ; then
# Create hw dir
echo "Creating $newdir/.$pwre_hw"
cp -pr $dir/hw_templ $newdir/.$pwre_hw
fi
fi
fi
done
}
#pwre_os="os_linux"
#pwre_hw="hw_x86"
cfile="$pwre_broot/pwre_${pwre_hw:3}_${pwre_os:3}.cnf"
dos=`eval echo ${pwre_os} | tr [:lower:] [:upper:]`
dhw=`eval echo ${pwre_hw} | tr [:lower:] [:upper:]`
conf_cc_define="-D$dos=1 -D$dhw=1 -DOS=${pwre_os:3} -DHW=${pwre_hw:3} -D_${dos:3}"
conf_lib=""
conf_libgtk=""
conf_libmotif=""
conf_libdir=""
conf_incdirgtk=""
let inc_cnt=0
let lib_cnt=0
let i=0
# Bash
if [ "$SHELL" != "/bin/bash" ] && [ "$SHELL" != "/usr/local/bin/bash" ]; then
echo "Config error: Default shell has to be bash"
exit
fi
echo "...Checking /bin/bash"
if test ! -e /bin/bash; then
if test -e /usr/local/bin/bash; then
echo "Config error: /bin/bash not found"
echo " Create link /bin/bash to /usr/local/bin/bash (ln -s /usr/local/bin/bash /bin/bash)"
else
echo "Config error: /bin/bash not found"
fi
exit
fi
if test "$pwre_broot" == ""; then
echo "Config error: pwre not initialized"
exit
fi
if test ! -w $pwre_broot; then
echo "Config error: pwre build root doesn't exist or is not writable"
exit
fi
if test ! -e $pwre_croot; then
echo "Config error: pwre source root doesn't exist"
exit
fi
pwre_create_blddir
pwre_create_makedir
pwre_config_init
#Gtk
pwre_config_check_lib gtk GTK gtk gtk 0 /sw/lib/libgtk-x11-2.0.dylib
pwre_config_check_lib libantlr LIBANTLR lib lib 0 /usr/local/lib/libantlr.a
pwre_config_check_lib librpcsvc LIBRPCSVC lib lib 0 /usr/lib/librpcsvc.dylib:/usr/lib/librpcsvc.a
pwre_config_check_lib libasound LIBASOUND lib lib 0 /usr/lib/libasound.dylib:/usr/lib/libasound.a
pwre_config_check_lib libpthread LIBPTHREAD lib lib 0 /usr/lib/libpthread.dylib:/usr/lib/libpthread.a
pwre_config_check_lib libm LIBM lib lib 0 /usr/lib/libm.dylib:/usr/lib/libm.a
pwre_config_check_lib libdb_cxx LIBDB_CXX lib lib 0 /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.dylib:/usr/lib/libdb_cxx.so
pwre_config_check_lib libz LIBZ lib lib 0 /usr/lib/libz.dylib:/usr/lib/libz.a
pwre_config_check_lib libcrypt LIBCRYPT lib lib 0 /usr/lib/libcrypt.dylib:/usr/lib/libcrypt.a
pwre_config_check_lib mysql MYSQL lib lib 1 /usr/lib/libmysqlclient.dylib
pwre_config_check_lib mq MQ lib lib 1 /usr/lib/libdmq.dylib
pwre_config_check_lib libpnioif PNAK lib lib 1 /usr/lib/libpnioif.so:/usr/local/lib/libpnioif.a
pwre_config_check_lib libusb LIBUSB lib lib 1 /usr/lib/libusb-1.0.so
pwre_config_check_lib librt LIBRT lib lib 0 /usr/lib/librt.dylib:/usr/lib/librt.a
pwre_config_check_lib libiconv LIBICONV lib lib 0 /usr/lib/libiconv.dylib
pwre_config_check_lib libfl LIBFL lib lib 0 /usr/lib/libfl.dylib:/usr/lib/libfl.a
#set -o xtrace
pwre_config_check_include antlr ANTLR 1 /usr/local/include/antlr/CommonAST.hpp
pwre_config_check_include gtk GTK 1 /sw/include/gtk-2.0/gtk/gtk.h
pwre_config_check_include jni JNI 1 /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h:$jdk/include/jni.h
pwre_config_check_include jni JNI 0 $jdk/include/linux/jni_md.h
pwre_config_check_include libdb_cxx LIBDB_CXX 0 /usr/local/BerkeleyDB.4.8/include/db_cxx.h:/usr/lib/db_cxx.h
export pwre_conf_alsa=1
let i=0
while [ $i -lt $inc_cnt ]; do
conf_incdir=$conf_incdir" -I${inc_array[$i]}"
i=$((i+1))
done
let i=0
while [ $i -lt $lib_cnt ]; do
conf_libdir=$conf_libdir" -L${lib_array[$i]}"
i=$((i+1))
done
rm $pwre_croot/src/exe/rt_prio/src/.${pwre_os}/.${pwre_hw}/makefile
#rm $pwre_croot/otherio/exp/rt/src/.${pwre_os}/.${pwre_hw}/makefile
rm $pwre_croot/remote/exe/rs_remote_alcm/src/.${pwre_os}/.${pwre_hw}/makefile
#rm $pwre_croot/profibus/lib/rt/src/.${pwre_os}/.${pwre_hw}/makefile
echo "export pwre_conf_cc_define=\"$conf_cc_define\"" >> $cfile
echo "export pwre_conf_libpwrco=\"-lpwr_co\"" >> $cfile
echo "export pwre_conf_libpwrrt=\"-lpwr_rt -lpwr_co -lpwr_statussrv -lpwr_msg_dummy\"" >> $cfile
echo "export pwre_conf_libpwrotherio=\"-lpwr_usbio_dummy -lpwr_usb_dummy\"" >> $cfile
echo "export pwre_conf_libpwrxtt=\"-lpwr_xtt -lpwr_ge -lpwr_cow -lpwr_flow -lpwr_glow\"" >> $cfile
echo "export pwre_conf_libpwrxttgtk=\" -lpwr_xtt_gtk -lpwr_ge_gtk -lpwr_cow_gtk -lpwr_flow_gtk -lpwr_glow_gtk\"" >> $cfile
echo "export pwre_conf_libpwrxttmotif=\"-lpwr_ge_motif -lpwr_cow_motif -lpwr_flow_motif -lpwr_glow_motif\"" >> $cfile
echo "export pwre_conf_libpwrwb=\"-lpwr_wb\"" >> $cfile
echo "export pwre_conf_libpwrwbgtk=\"-lpwr_wb_gtk\"" >> $cfile
echo "export pwre_conf_libpwrwbmotif=\"-lpwr_wb_motif\"" >> $cfile
echo "export pwre_conf_libpwropc=\"-lpwr_opc\"" >> $cfile
echo "export pwre_conf_libpwrremote=\"-lpwr_remote\"" >> $cfile
echo "export pwre_conf_libpwrnmps=\"-lpwr_nmps\"" >> $cfile
echo "export pwre_conf_libpwrtlog=\"-lpwr_tlog\"" >> $cfile
echo "export pwre_conf_libpwrsev=\"-lpwr_sev\"" >> $cfile
echo "export pwre_conf_lib=\"$conf_lib\"" >> $cfile
echo "export pwre_conf_libgtk=\"$conf_libgtk\"" >> $cfile
echo "export pwre_conf_libmotif=\"$conf_libmotif\"" >> $cfile
echo "export pwre_conf_libdir=\"$conf_libdir\"" >> $cfile
echo "export pwre_conf_incdir=\"$conf_incdir\"" >> $cfile
echo "export pwre_conf_incdirgtk=\"$conf_incdirgtk\"" >> $cfile
#
# Proview build environment setup
#
# Environment variables
#
# $pwre_croot Common source root, pwr
# $pwre_kroot Rt source root, pwr/src
# $pwre_sroot Module source root, eg. pwr/ssabox
# $pwre_broot Common build root
# $pwre_module Module name in source tree, eg. 'ssabox'
# $pwre_bmodule Module name in build tree, eg. 'ssabox'
# $pwre_os Operating system, eg. 'os_linux'
# $pwre_hw Hardware, eg. 'hw_x86'
# $pwr_exe Exe directory for module build root, eg. ssabox/exe
# $pwr_load Load directory for module build root
# $pwr_inc Inc directory for module build root
# $pwr_obj Obj directory for module build root
# $pwr_lib Lib directory for module build root
# $pwr_eexe Exe directory for common build root, ex. exp/exe
# $pwr_eload Load directory for common build root
# $pwr_einc Inc directory for common build root
# $pwr_eobj Obj directory for common build root
# $pwr_elib Lib directory for common build root
pwre()
{
if [ "$HOSTTYPE" = "alpha" ]; then
pwre_silent="-q"
else
pwre_silent="-s"
fi
export pwre_hosttype=$HOSTTYPE
local flags="$-"
if [ -e $pwre_broot/pwre_${pwre_hw:3}_${pwre_os:3}.cnf ]; then
source $pwre_broot/pwre_${pwre_hw:3}_${pwre_os:3}.cnf
fi
# Turn off filename globber
set -f
source $pwre_bin/pwre.source $@
if echo "$flags" | grep $pwre_silent -v f; then
set +f
fi
}
set_env()
{
if [ "$pwr_eexe" != "" ]; then
export PATH=${PATH%:$pwr_eexe}
export PATH=${PATH%:$pwr_exe}
fi
module=$pwre_module
if [ $module = "rt" ]; then
module=src
fi
sroot=${1%/*}
export pwre_croot=$sroot
export pwre_sroot=$sroot/$module
export pwre_kroot=$sroot/src
export pwre_env="$env"
export pwre_vmsinc="$2"
export pwre_broot="$3"
export pwre_btype="$4"
export pwre_os="os_$5"
export pwre_hw="hw_$6"
export pwre_target="$pwre_os/$pwre_hw"
export pwre_bin="$pwre_kroot/tools/pwre/src/$pwre_os"
export pwre_dir_symbols="$pwre_bin/dir_symbols.mk"
export pwr_exe="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/exe"
export pwr_inc="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/inc"
export pwr_load="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/load"
export pwr_lib="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/lib"
export pwr_lis="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/lis"
export pwr_obj="$pwre_broot/$pwre_os/$pwre_hw/$pwre_bmodule/obj"
# Common doc
export pwr_doc="$pwre_broot/$pwre_os/$pwre_hw/exp/doc"
export pwr_eexe="$pwre_broot/$pwre_os/$pwre_hw/exp/exe"
export pwr_einc="$pwre_broot/$pwre_os/$pwre_hw/exp/inc"
export pwr_eload="$pwre_broot/$pwre_os/$pwre_hw/exp/load"
export pwr_elib="$pwre_broot/$pwre_os/$pwre_hw/exp/lib"
export pwr_elis="$pwre_broot/$pwre_os/$pwre_hw/exp/lis"
export pwr_eobj="$pwre_broot/$pwre_os/$pwre_hw/exp/obj"
export pwr_edoc="$pwre_broot/$pwre_os/$pwre_hw/exp/doc"
export pwrp_load="./"
export pwrp_pop="./"
export co_lib="$pwre_kroot/lib/co/src"
export op_lib="$pwre_kroot/lib/op/src"
export rt_lib="$pwre_kroot/lib/rt/src"
export wb_lib="$pwre_kroot/lib/wb/src"
export exe="$pwre_kroot/exe"
# PWR alias
alias pwr_root="cd $pwre_kroot"
alias pwr_exe="cd $pwr_exe"
alias pwr_inc="cd $pwr_inc"
alias pwr_load="cd $pwr_load"
alias pwr_lib="cd $pwr_lib"
alias pwr_lis="cd $pwr_lis"
alias pwr_obj="cd $pwr_obj"
alias co_lib="cd $pwre_kroot/lib/co/src"
alias op_lib="cd $pwre_kroot/lib/op/src"
alias rt_lib="cd $pwre_kroot/lib/rt/src"
alias wb_lib="cd $pwre_kroot/lib/wb/src"
alias db="cd $pwre_kroot/db"
alias exe="cd $pwre_kroot/exe"
alias exp="cd $pwre_kroot/exp"
alias inc="cd $pwre_kroot/exp/inc/src"
alias lib="cd $pwre_kroot/lib"
alias hlp="cd $pwre_kroot/hlp"
alias mmi="cd $pwre_kroot/mmi"
alias msg="cd $pwre_kroot/msg"
alias tools="cd $pwre_kroot/tools"
alias wbl="cd $pwre_kroot/wbl"
alias hw="cd $pwre_target"
alias bld="cd $pwre_broot/$pwre_target/bld"
alias co_bld="cd $pwre_broot/$pwre_target/bld/lib/co"
alias rt_bld="cd $pwre_broot/$pwre_target/bld/lib/rt"
alias exe_bld="cd $pwre_broot/$pwre_target/bld/exe"
alias tmp="cd $pwre_broot/$pwre_target/tmp"
pwre_get_variables
export PWRP_DB=$pwr_my_sqlserver":wb_template_"$pwr_dbversion
# export CLASSPATH=$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/rt:$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/jop:$pwre_broot/$pwre_os/$pwre_hw/bld/jpwr/beans
export CLASSPATH=$pwre_broot/$pwre_target/bld
export PATH=$PATH:$pwr_exe:$pwr_eexe
# Configure
# Dmq
if [ -e /usr/lib/libdmq.so ]; then
export pwre_conf_mq=1
else
export pwre_conf_mq=0
fi
# Mysql
if [ -e /usr/lib/libmysqlclient.so ] || [ -e /usr/lib/mysql/libmysqlclient.so ]; then
export pwre_conf_mysql=1
else
export pwre_conf_mysql=0
fi
# Gtk
if [ -e /usr/lib/libgtk-x11-2.0.so ]; then
export pwre_conf_gtk=1
else
export pwre_conf_gtk=0
fi
# libusb
if [ -e /usr/lib/libusb-1.0.so ]; then
export pwre_conf_libusb=1
else
export pwre_conf_libusb=0
fi
export pwre_conf_alsa=1
}
pwre_get_variables()
{
local socket
socket=`eval cat /etc/proview.cnf | grep "\bmysql_socket\b" | awk '{print $2}'`
if [ ! -z $socket ]; then
mysql_socket="--socket $socket"
fi
if [ -n $pwre_kroot ]; then
pwr_dbversion=`eval cat $pwre_kroot/exp/inc/src/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'`
if [ -z $pwr_dbversion ]; then
echo "Unable to get pwr db version"
fi
export pwr_dbversion=${pwr_dbversion:1:3}
export pwre_dbversion=$pwr_dbversion
fi
}
#!/bin/bash
#
# Merge build tree for a module to common build tree
#
merge_dir_func()
{
local todir=$1
local fromdir=$2
local singlefile=$3
if [ "$singlefile" != "" ]; then
files=$singlefile
todir=$todir/${singlefile%/*}
else
files=`eval ls $fromdir 2>/dev/null`
fi
if [ ! -z "$files" ]; then
for file in $files; do
if [ ! -d $fromdir/$file ]; then
if [ -e $todir/$file ]; then
if [ $todir/$file -ot $fromdir/$file ]; then
echo "Copy $fromdir/$file"
cp $fromdir/$file $todir
fi
else
echo "Copy $fromdir/$file"
cp $fromdir/$file $todir
if [ ${file##*.} = "dbs" ]; then
# Change access on dbsfiles
chmod a+w $todir/$file
fi
fi
fi
done
fi
}
fromroot=$1
toroot=$2
file=$3
if [ "$file" != "" ]; then
# Merge only this file
merge_dir_func $toroot $fromroot $file
else
# Copy exe, load, obj and inc
merge_dir_func $toroot/exe $fromroot/exe
merge_dir_func $toroot/exe/sv_se $fromroot/exe/sv_se
merge_dir_func $toroot/exe/en_us $fromroot/exe/en_us
merge_dir_func $toroot/exe/de_de $fromroot/exe/de_de
merge_dir_func $toroot/inc $fromroot/inc
merge_dir_func $toroot/load $fromroot/load
merge_dir_func $toroot/obj $fromroot/obj
# Merge archives
cd ${toroot%/*}/tmp
libraries=`eval ls $fromroot/lib/* 2>/dev/null`
for lib in $libraries; do
arname=${lib##/*/}
if [ $arname = "libpwr_rt.a" ] || [ $arname = "libpwr_cow.a" ] || [ $arname = "libpwr_cow_motif.a" ] || [ $arname = "libpwr_cow_gtk.a" ] || [ $arname = "libpwr_wb.a" ] || [ $arname = "libpwr_wb_motif.a" ] || [ $arname = "libpwr_wb_gtk.a" ] || [ $arname = "libpwr_xtt.a" ] || [ $arname = "libpwr_xtt_motif.a" ] || [ $arname = "libpwr_xtt_gtk.a" ]; then
echo "Merge $lib"
modules=`eval ar -t $lib`
ar -x $lib
ar -rc $toroot/lib/$arname $modules
rm $modules
else
echo "Copy $lib"
cp $lib $toroot/lib/
fi
done
# Merge io methods
methodfile=$pwr_inc/rt_io_$pwre_module.meth
if [ -e $methodfile ]; then
echo "-- Merge io methods"
co_merge io_base $pwr_einc/rt_io_\*.meth $pwr_elib/libpwr_rt.a
fi
# Merge wb methods
methodfile=$pwr_inc/wb_$pwre_module.meth
if [ -e $methodfile ]; then
echo "-- Merge wb methods"
co_merge wb_base $pwr_einc/wb_\*.meth $pwr_elib/libpwr_wb.a
fi
# Merge xtt methods
methodfile=$pwr_inc/xtt_$pwre_module.meth
if [ -e $methodfile ]; then
echo "-- Merge xtt methods"
co_merge xtt_base $pwr_einc/xtt_\*.meth $pwr_elib/libpwr_xtt.a
fi
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment