Commit d0c6ab24 authored by root's avatar root

ARM, first commit

parent a37ad715
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
copy : $(doc_dir)/sv_se/orm/nmps_plc_c.html \
$(doc_dir)/en_us/orm/nmps_plc_c.html \
$(doc_dir)/sv_se/orm/nmps_plc_display_c.html \
$(doc_dir)/en_us/orm/nmps_plc_display_c.html \
$(doc_dir)/sv_se/orm/nmps_plc_runtime_c.html \
$(doc_dir)/en_us/orm/nmps_plc_runtime_c.html \
$(doc_dir)/sv_se/orm/nmps_plc_macro_h.html \
$(doc_dir)/en_us/orm/nmps_plc_macro_h.html \
$(doc_dir)/sv_se/orm/nmps_plc_c.html : ../../nmps_plc.c
@ echo "Generating html files for nmps_plc sv_se..."
@ co_convert -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/nmps_plc_c.html : ../../nmps_plc.c
@ echo "Generating html files for nmps_plc en_us..."
@ co_convert -c -d $(doc_dir)/en_us/orm "$(source)"
$(doc_dir)/sv_se/orm/nmps_plc_display_c.html : ../../nmps_plc_display.c
@ echo "Generating html files for nmps_plc_display sv_se..."
@ co_convert -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/nmps_plc_display_c.html : ../../nmps_plc_display.c
@ echo "Generating html files for nmps_plc_display en_us..."
@ co_convert -c -d $(doc_dir)/en_us/orm "$(source)"
$(doc_dir)/sv_se/orm/nmps_plc_runtime_c.html : ../../nmps_plc_runtime.c
@ echo "Generating html files for nmps_plc_runtime sv_se..."
@ co_convert -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/nmps_plc_runtime_c.html : ../../nmps_plc_runtime.c
@ echo "Generating html files for nmps_plc_runtime en_us..."
@ co_convert -c -d $(doc_dir)/en_us/orm "$(source)"
$(doc_dir)/sv_se/orm/nmps_plc_macro_h.html : ../../nmps_plc_macro.h
@ echo "Generating html files for nmps_plc_macro sv_se..."
@ co_convert -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/nmps_plc_macro_h.html : ../../nmps_plc_macro.h
@ echo "Generating html files for nmps_plc_macro en_us..."
@ co_convert -c -d $(doc_dir)/en_us/orm "$(source)"
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
copy : $(doc_dir)/sv_se/orm/remote_plc_macro_h.html \
$(doc_dir)/en_us/orm/remote_plc_macro_h.html
$(doc_dir)/sv_se/orm/remote_plc_macro_h.html : ../../remote_plc_macro.h
@ echo "Generating html files for remote_plc_macro sv_se..."
@ co_convert -c -d $(doc_dir)/sv_se/orm "$(source)"
$(doc_dir)/en_us/orm/remote_plc_macro_h.html : ../../remote_plc_macro.h
@ echo "Generating html files for remote_plc_macro en_us..."
@ co_convert -c -d $(doc_dir)/en_us/orm "$(source)"
......@@ -57,6 +57,10 @@ int main( int argc, char *argv[])
pwr_tFileName incdir;
pwr_tFileName cfile;
pwr_tFileName ofile;
char pwre_cc[80];
char pwre_cxx[80];
char pwre_ar[80];
char *s;
#if defined OS_LINUX
char dos[] = "OS_LINUX";
#elif defined OS_MACOS
......@@ -67,6 +71,20 @@ int main( int argc, char *argv[])
exit(1);
}
if ( (s = getenv( "pwre_cc")))
strncpy( pwre_cc, s, sizeof(pwre_cc));
else
strcpy( pwre_cc, "gcc");
if ( (s = getenv( "pwre_cxx")))
strncpy( pwre_cxx, s, sizeof(pwre_cxx));
else
strcpy( pwre_cxx, "g++");
if ( (s = getenv( "pwre_ar")))
strncpy( pwre_ar, s, sizeof(pwre_ar));
else
strcpy( pwre_ar, "ar");
if ( strcmp( argv[1], "io_base") == 0)
mtype = merge_eMtype_IoBase;
else if ( strcmp( argv[1], "wb_base") == 0)
......@@ -177,14 +195,14 @@ int main( int argc, char *argv[])
dcli_translate_filename( incdir, "$pwr_einc");
switch ( mtype) {
case merge_eMtype_WbBase:
sprintf( cmd, "g++ -c -I%s -D%s -o %s %s", incdir, dos, ofile, cfile);
sprintf( cmd, "%s -c -I%s -D%s -o %s %s", pwre_cxx, incdir, dos, ofile, cfile);
break;
default:
sprintf( cmd, "gcc -c -I%s -D%s -o %s %s", incdir, dos, ofile, cfile);
sprintf( cmd, "%s -c -I%s -D%s -o %s %s", pwre_cc, incdir, dos, ofile, cfile);
}
// printf( "co_merge: %s\n", cmd);
system( cmd);
sprintf( cmd, "ar r %s %s", outfile, ofile);
sprintf( cmd, "%s r %s %s", pwre_ar, outfile, ofile);
// printf( "co_merge: %s\n", cmd);
system(cmd);
sprintf( cmd, "rm %s", ofile);
......
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
......@@ -5,11 +5,11 @@ ifeq ($(export_type),exp)
link = $(ld) $(explinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs) $(rs_msg_objs)\
$(pwr_obj)/rt_io_user.o \
-lpwr_rt -lpwr_co -lpwr_msg_dummy -lpthread -lm
-lpwr_rt -lpwr_co -lpwr_msg_dummy -lpthread -lm -lrt
else
link = $(ld) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(rt_msg_objs) $(rs_msg_objs)\
$(pwr_obj)/rt_io_user.o \
-lpwr_rt -lpwr_co -lpwr_msg_dummy -lpthread -lm
-lpwr_rt -lpwr_co -lpwr_msg_dummy -lpthread -lm -lrt
endif
endif
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
......@@ -4,9 +4,9 @@ link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(wb_msg_objs) $(rt_msg_objs) \
$(pwr_obj)/rt_io_user.o \
-lpwr_rt -lpwr_co $(linkmysql)\
-lpwr_rt -lpwr_co \
-lpwr_msg_dummy \
-lrpcsvc -lpthread -lm -lrt -ldb_cxx -lz -lcrypt
-lrpcsvc -lpthread -lm -lrt -lcrypt
#-lpwr_wb -lpwr_rt -lpwr_ge -lpwr_flow -lpwr_glow -lpwr_co \
# -L/usr/X11R6/lib -L/usr/local/BerkeleyDB.4.0/lib \
......
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
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
ifndef rules_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.sh $(hw_source):$(os_source):$(co_source)
vpath %.pwr_com $(hw_source):$(os_source):$(co_source)
vpath %.awk $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source)
sh_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.sh) \
), $(notdir $(file)) \
) \
)
pwr_com_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.pwr_com) \
), $(notdir $(file)) \
) \
)
awk_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.awk) \
), $(notdir $(file)) \
) \
)
export_sh := $(patsubst %.sh, $(exe_dir)/%.sh, $(sh_sources))
clean_sh := $(patsubst %.sh, clean_%.sh, $(sh_sources))
export_pwr_com := $(patsubst %.pwr_com, $(exe_dir)/%.pwr_com, $(pwr_com_sources))
clean_pwr_com := $(patsubst %.pwr_com, clean_%.pwr_com, $(pwr_com_sources))
export_awk := $(patsubst %.awk, $(exe_dir)/%.awk, $(awk_sources))
clean_awk := $(patsubst %.awk, clean_%.awk, $(awk_sources))
.PHONY : all init copy lib exe clean realclean\
$(clean_sh)
all : init copy
init :
copy : $(export_sh) $(export_pwr_com) $(export_awk)
lib :
exe :
clean :
realclean : clean $(clean_sh) $(clean_pwr_com) $(clean_awk)
$(export_sh) : $(exe_dir)/%.sh : %.sh
@ echo "Exporting $< ..."
@ $(cp) $(cpflags) $(source) $(target)
$(export_pwr_com) : $(exe_dir)/%.pwr_com : %.pwr_com
@ echo "Exporting $< ..."
@ $(cp) $(cpflags) $(source) $(target)
$(export_awk) : $(exe_dir)/%.awk : %.awk
@ echo "Exporting $< ..."
@ $(cp) $(cpflags) $(source) $(target)
$(clean_sh) : clean_%.sh : %.sh
@ rm $(exe_dir)/$*.sh
$(clean_pwr_com) : clean_%.pwr_com : %.pwr_com
@ rm $(exe_dir)/$*.pwr_com
$(clean_awk) : clean_%.awk : %.awk
@ rm $(exe_dir)/$*.awk
#!/bin/bash
#
# Proview $Id: wb_rtt_comppicture.sh,v 1.2 2005-09-01 14:57:49 claes Exp $
# Copyright (C) 2005 SSAB Oxelsund AB.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the program, if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
# Compile a rtt picture
#
# set -o xtrace
name=$1
pgmname=$2
is_rttsys=$3
opsys=$4
# echo $name $pgmname $is_rttsys $opsys
if [ $opsys = "512" ]
then
# echo "Opsys is linux"
if [ $is_rttsys = "0" ]
then
ar_name_pict=${pwrp_lib}/ra_rtt_${pgmname}_pict.a
cc=arm-linux-gnueabi-gcc-4.3
cinc="-I$pwr_inc -I$pwrp_rttbld"
cflags="-DOS_LINUX -DOS=linux -DHW_ARM=1 -DPOSIX_SOURCE -DWall"
${cc} -c -o $pwrp_obj/${name}.o $pwrp_rttbld/${name}.c ${cinc} ${cflags}
ar rc ${ar_name_pict} $pwrp_obj/${name}.o
else
# echo "Is rttsys"
ar_name_pict=${pwr_lib}/libpwr_dtt.a
bld_dir=$pwre_broot/$pwre_os/$pwre_hw/bld/lib/dtt
# echo $ar_name $ar_name_pict
cc=arm-linux-gnueabi-gcc-4.3
cinc="-I$pwr_inc -I${bld_dir}"
cflags="-DOS_LINUX -DOS=linux -DHW_ARM=1 -DPOSIX_SOURCE -DWall"
${cc} -c -o ${bld_dir}/${name}.o \
${bld_dir}/${name}.c ${cinc} ${cflags}
ar rc ${ar_name_pict} ${bld_dir}/${name}.o
fi
else
echo "Opsys ($opsys) is not linux, not yet supported"
# if [ $is_rttsys = "0" ]
# then
# echo "Not rttsys"
# else
# echo "Is rttsys"
# fi
fi
include $(pwre_dir_symbols)
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
ifndef rules_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.h $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source)
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.h) \
), $(notdir $(file)) \
) \
)
export_includes := $(addprefix $(inc_dir)/,$(sources))
clean_includes := $(patsubst %.h,clean_%.h,$(sources))
.SUFFIXES:
.PHONY : all init copy lib exe clean realclean \
$(clean_includes)
all : init copy lib exe
init :
copy : $(export_includes) $(exe_dir)/pwrp_rules.mk
lib :
exe :
clean :
realclean : $(clean_includes)
$(clean_includes) : clean_%.h : %.h
@ $(rm) $(rmflags) $(inc_dir)/$*.h
$(exe_dir)/pwrp_rules.mk : ../../pwrp_rules.mk
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
......@@ -620,7 +620,8 @@ typedef enum {
pwr_mOpSys_X86_LINUX = 1 << 6,
pwr_mOpSys_X86_64_LINUX = 1 << 7,
pwr_mOpSys_X86_64_MACOS = 1 << 8,
pwr_mOpSys_ = 1 << 9,
pwr_mOpSys_ARM_LINUX = 1 << 9,
pwr_mOpSys_ = 1 << 10,
pwr_mOpSys_VAX_ELN = 1 << 30 /* TODO Remove! */
} pwr_mOpSys;
......
include $(pwre_dir_symbols)
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
ifndef rules_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.c $(hw_source):$(os_source):$(co_source)
vpath %.dat $(hw_source):$(os_source):$(co_source)
vpath %.gif $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source)
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.c) \
), $(notdir $(file)) \
) \
)
c_sources := $(filter %.c,$(sources))
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.gif) \
), $(notdir $(file)) \
) \
)
gif_sources := $(filter %.gif,$(sources))
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.wav) \
), $(notdir $(file)) \
) \
)
wav_sources := $(filter %.wav,$(sources))
export_obj := $(patsubst %.c,$(obj_dir)/%.o,$(c_sources))
clean_obj := $(patsubst %.c,clean_%.o,$(c_sources))
export_gif := $(patsubst %.gif,$(exe_dir)/%.gif,$(gif_sources))
export_gifdoc := $(patsubst %.gif,$(doc_dir)/help/%.gif,$(gif_sources))
export_wav := $(patsubst %.wav,$(exe_dir)/%.wav,$(wav_sources))
.PHONY : all init copy lib exe clean realclean\
$(clean_c)
all : init copy lib
init :
copy : $(load_dir)/pwr_volumelist.dat $(exe_dir)/sv_se/pwrb_xtthelp.dat $(exe_dir)/pwr_logga.gif $(export_gif) $(export_gifdoc) $(export_wav)
lib : $(export_obj)
exe :
clean :
realclean : clean $(clean_obj)
.SUFFIXES:
$(exe_dir)/%.wav : ../../%.wav
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
$(load_dir)/pwr_volumelist.dat : ../../pwr_volumelist.dat
@ echo "Copying pwr_volumelist.dat"
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/sv_se/pwrb_xtthelp.dat : ../../pwrb_xtthelp.dat_sv_se
@ #echo "Copying pwrb_xtthelp.dat sv_se"
@ #$(cp) $(cpflags) $(source) $(target)
@ #co_convert -t -d $(pwr_doc)/sv_se $(source)
$(exe_dir)/pwr_logga.gif : ../../pwr_logga.gif
@ echo "Copying pwr_logga.gif"
@ $(cp) $(cpflags) $(source) $(target)
$(exe_dir)/%.gif : ../../%.gif
@ echo "Copying $(source).gif exe"
@ $(cp) $(cpflags) $(source) $(target)
$(doc_dir)/help/%.gif : ../../%.gif
@ echo "Copying $(source).gif doc/help"
@ $(cp) $(cpflags) $(source) $(target)
$(clean_obj) : clean_%.o : %.c
rm $(obj_dir)/$*.o
include $(pwre_dir_symbols)
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
ifndef rules_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/rules.mk
endif
vpath %.c $(hw_source):$(os_source):$(co_source)
vpath %.cpp $(hw_source):$(os_source):$(co_source)
vpath %.h $(hw_source):$(os_source):$(co_source)
source_dirs = $(hw_source) $(os_source) $(co_source)
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.c) \
), $(notdir $(file)) \
) \
)
c_sources := $(filter %.c,$(sources))
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.cpp) \
), $(notdir $(file)) \
) \
)
cpp_sources := $(filter %.cpp,$(sources))
sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.h) \
), $(notdir $(file)) \
) \
)
h_sources := $(filter %.h,$(sources))
export_obj := $(patsubst %.c,$(obj_dir)/%.o,$(c_sources)) \
$(patsubst %.cpp,$(obj_dir)/%.o,$(cpp_sources))
export_h := $(patsubst %.h,$(inc_dir)/%.h,$(h_sources))
.PHONY : all init copy lib exe clean realclean
all : init copy lib
init :
copy : $(export_h)
lib : $(export_obj)
exe :
clean :
realclean : clean
.SUFFIXES:
......@@ -115,6 +115,7 @@ typedef enum {
co_eHW_Alpha,
co_eHW_PPC,
co_eHW_x86_64,
co_eHW_ARM,
co_eHW_
} co_eHW;
......@@ -122,6 +123,8 @@ typedef enum {
# define co_dHostHW co_eHW_x86
#elif defined(HW_X86_64)
# define co_dHostHW co_eHW_x86_64
#elif defined(HW_ARM)
# define co_dHostHW co_eHW_ARM
#elif defined(HW_VAX)
# define co_dHostHW co_eHW_VAX
#elif defined(HW_AXP)
......
......@@ -147,6 +147,8 @@ const char *syi_Hardware()
{
#if defined HW_X86_64
static const char hw[] = "x86_64";
#elif defined HW_ARM
static const char hw[] = "ARM";
#else
static const char hw[] = "x86";
#endif
......
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
# makefile -- makefile for dtt library
#
# PROVIEW/R
# Copyright (C) 2000 Mandator AB.
#
# To build a dtt library.
#
include $(pwre_dir_symbols)
ifndef lib_generic_mk
lib_generic_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
ifndef rules_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/rules.mk
endif
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 %.dtt $(hw_source):$(os_source):$(co_source)
vpath %.dtt_m $(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)/$(comp_name)*.c $(dir)/$(comp_name)*.cpp $(dir)/$(comp_name)*.sc) \
), $(notdir $(file)) \
) \
)
includes := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.h $(dir)/$(comp_name)*.hpp) \
), $(notdir $(file)) \
) \
)
xdr_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.x) \
), $(notdir $(file)) \
) \
)
dtt_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.dtt) \
), $(notdir $(file)) \
) \
)
xdr_includes := $(addprefix $(inc_dir)/,$(patsubst %.x, %.h, $(xdr_sources)))
xdr_objects := $(patsubst %.x, %_xdr.o, $(xdr_sources))
export_includes := $(addprefix $(inc_dir)/, $(includes))
export_includes += $(xdr_includes)
export_dtt_m := $(bld_dir)/dtt_appl_rttsys_m.c
export_obj := $(addprefix $(obj_dir)/, $(c_sources))
export_obj := $(patsubst %.c, %.o, $(export_obj))
h_includes := $(filter %.h, $(includes))
hpp_includes := $(filter %.hpp, $(includes))
clean_h_includes := $(patsubst %.h,clean_%.h, $(h_includes))
clean_hpp_includes := $(patsubst %.hpp,clean_%.hpp, $(hpp_includes))
objects := $(addsuffix $(obj_ext), $(basename $(dtt_sources)))
#objects += $(xdr_objects)
source_dependencies := $(notdir $(basename $(c_sources)))
source_dependencies := $(addprefix $(bld_dir)/, $(source_dependencies))
source_dependencies := $(addsuffix $(d_ext), $(source_dependencies))
lib_name = libpwr_$(comp_name)
export_lib = $(lib_dir)/$(lib_name)$(lib_ext)
.PHONY : all init copy lib exe $(clean realclean \
dirs $(clean_h_includes) $(clean_hpp_includes) \
clean_bld clean_dirs clean_lib export_stuff
all : init copy lib exe
init : dirs
copy : $(export_includes)
lib : $(export_dtt_m)\
$(inc_dir)/dtt_appl_rttsys_m.rdecl\
$(inc_dir)/dtt_appl_rttsys_m.rhlp\
$(inc_dir)/dtt_appl_rttsys_m.rh\
$(export_lib)($(objects))\
$(export_obj)
exe :
dirs : $(bld_dir)$(dir_ext)
$(inc_dir)/dtt_appl_rttsys_m.rdecl : $(bld_dir)/dtt_appl_rttsys_m.rdecl
@ echo "copy $(source) $(target)"
@ cp $(source) $(target)
$(inc_dir)/dtt_appl_rttsys_m.rhlp : ../../dtt_appl_rttsys_m.rhlp
@ echo "copy $(source) $(target)"
@ cp $(source) $(target)
$(inc_dir)/dtt_appl_rttsys_m.rh : $(bld_dir)/dtt_appl_rttsys_m.rh
@ echo "copy $(source) $(target)"
@ cp $(source) $(target)
$(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))"
@ $(rm) $(export_lib)
@ $(ar) -cr $(export_lib) $(objects)
$(obj_dir)/%.o : %.c
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cc) -MM -I$(bld_dir) $(cinc) $(csetos) $(source) \
| sed '\''s|$*\.o[ ]*|$(obj_dir)/&|g'\'' > $(obj_dir)/$(sname).d'
endif
@ $(log_c_obj)
@ $(cc) $(cflags) $(csetos) -I$(bld_dir) $(cinc) $(cobj) $(source)
#$(obj_dir)/%.o : %.c
# @ $(log_c_obj)
# $(cc) $(cflags) $(depmms) -I$(bld_dir) $(cinc) $(csetos) $(cobj) $(clis) $(source) $(clib)
$(export_lib)(%.o) : %.dtt
@ echo "Generate $(sname)"
@ $(pwr_exe)/wb_rtt rttsys generate/id=$(sname) arm_linux
$(bld_dir)/%.c : %.dtt_m
@ echo "Generate menu"
@ $(pwr_exe)/wb_rtt rttsys generate/menu arm_linux
-include $(source_dependencies)
endif
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
......@@ -211,7 +211,7 @@ dlinux_sfloat (
return TRUE;
}
#elif defined(OS_LINUX) && (defined(HW_X86) || defined(HW_X86_64))
#elif defined(OS_LINUX) && (defined(HW_X86) || defined(HW_X86_64) || defined(HW_ARM))
static pwr_tBoolean
dlinux_sfloat (
......
......@@ -317,7 +317,7 @@ encode_sfloat (
return TRUE;
}
#elif (defined(OS_LYNX) || defined(OS_LINUX) || defined(OS_MACOS)) && (defined(HW_X86) || defined(HW_X86_64))
#elif (defined(OS_LYNX) || defined(OS_LINUX) || defined(OS_MACOS)) && (defined(HW_X86) || defined(HW_X86_64) || defined(HW_ARM))
static pwr_tBoolean
encode_sfloat (
......@@ -387,7 +387,7 @@ decode_sfloat (
return TRUE;
}
#elif (defined(OS_LYNX) || defined(OS_LINUX) || defined(OS_MACOS)) && (defined(HW_X86) || defined(HW_X86_64))
#elif (defined(OS_LYNX) || defined(OS_LINUX) || defined(OS_MACOS)) && (defined(HW_X86) || defined(HW_X86_64) || defined(HW_ARM))
static pwr_tBoolean
decode_sfloat(
......
......@@ -1012,6 +1012,8 @@ static int generate_func( edit_ctx ctx,
opsys = pwr_mOpSys_X86_64_LINUX;
else if ( cdh_NoCaseStrncmp( arg1_str, "X86_64_MACOS", strlen( arg1_str)) == 0)
opsys = pwr_mOpSys_X86_64_MACOS;
else if ( cdh_NoCaseStrncmp( arg1_str, "ARM_LINUX", strlen( arg1_str)) == 0)
opsys = pwr_mOpSys_ARM_LINUX;
else
{
rtt_message('E', "Unknown platform");
......@@ -1753,6 +1755,8 @@ static int dtt_link_func( edit_ctx ctx,
opsys = pwr_mOpSys_X86_64_MACOS;
else if ( cdh_NoCaseStrncmp( arg1_str, "X86_64_MACOS", strlen( arg1_str)) == 0)
opsys = pwr_mOpSys_X86_64_MACOS;
else if ( cdh_NoCaseStrncmp( arg1_str, "ARM_LINUX", strlen( arg1_str)) == 0)
opsys = pwr_mOpSys_ARM_LINUX;
else
{
rtt_message('E', "Unknown platform");
......@@ -1859,6 +1863,8 @@ static int dtt_compile_func( edit_ctx ctx,
opsys = pwr_mOpSys_X86_64_LINUX;
else if ( cdh_NoCaseStrncmp( arg1_str, "X86_64_MACOS", strlen( arg1_str)) == 0)
opsys = pwr_mOpSys_X86_64_MACOS;
else if ( cdh_NoCaseStrncmp( arg1_str, "ARM_LINUX", strlen( arg1_str)) == 0)
opsys = pwr_mOpSys_ARM_LINUX;
else
{
rtt_message('E', "Unknown platform");
......@@ -7793,12 +7799,16 @@ int dtt_start( char *programname)
#elif defined(OS_LYNX) || defined(OS_LINUX) || defined OS_MACOS
if ( dtt_is_rttsys)
{
pwr_tFileName dir;
char *s1;
if ( (s = getenv( "pwre_sroot")) == NULL)
{
printf( "** Rtt source directory pwrp_rtt is not defined\n");
dtt_exit_now(0);
}
sprintf( dtt_source_dir, "%s/lib/dtt/src/", s);
#if 0
if ( (s = getenv( "pwre_broot")) == NULL)
{
printf( "** Rtt build directory pwrp_rttbld is not defined\n");
......@@ -7806,12 +7816,22 @@ int dtt_start( char *programname)
}
sprintf( dtt_build_dir, "%s/os_%s/hw_%s/bld/lib/dtt/", s, rtt_os,
rtt_hw);
#endif
if ( (s = getenv( "pwr_exe")) == NULL)
{
printf( "** Rtt execute directory pwr_exe is not defined\n");
dtt_exit_now(0);
}
sprintf( dtt_exe_dir, "%s/", s);
strcpy( dir, s);
s1 = strrchr( dir, '/');
if ( s1)
*s1 = 0;
s1 = strrchr( dir, '/');
if ( s1)
*s1 = 0;
strcat( dir, "/bld/lib/dtt/");
strcpy( dtt_build_dir, dir);
}
else
{
......@@ -10589,6 +10609,7 @@ static char *dtt_opsys_to_name( int opsys)
case pwr_mOpSys_X86_LINUX: strcpy( name, "X86_LINUX"); break;
case pwr_mOpSys_X86_64_LINUX: strcpy( name, "X86_64_LINUX"); break;
case pwr_mOpSys_X86_64_MACOS: strcpy( name, "X86_64_MACOS"); break;
case pwr_mOpSys_ARM_LINUX: strcpy( name, "ARM_LINUX"); break;
default: strcpy( name, "Unknwn");
}
return name;
......
......@@ -46,10 +46,6 @@
#define NULLOI {0,0}
#if defined(OS_LYNX) || defined(OS_LINUX) || defined(OS_MACOS)
# define VAXC$ESTABLISH( t) {}
#endif
#define RTT_HELP_START \
extern rtt_t_helptext rtt_appl_helptext[]; \
rtt_t_helptext rtt_appl_helptext[] = {
......@@ -368,7 +364,6 @@ char username[40]; \
char password[40]; \
char commandfile[80]; \
\
VAXC$ESTABLISH( rtt_exception); \
rtt_args = argc - 1; \
for ( i = 0; i < rtt_args; i++) { \
if ( i >= (int)(sizeof(rtt_arg)/sizeof(rtt_arg[0]))) \
......
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_sroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
# 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
log_done =
csetos := -DOS_LINUX=1 -DOS=linux -D_LINUX -DHW_ARM=1 -DHW=ARM
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source)
rm := rm
cp := cp
cpflags :=
ar := arm-linux-gnueabi-ar
arflags := r
obj := -c -o $(target)
cc := arm-linux-gnueabi-gcc-4.3
ld := arm-linux-gnueabi-gcc-4.3
cxx := arm-linux-gnueabi-g++-4.3
ldxx := arm-linux-gnueabi-g++-4.3
lex := flex
msg2cmsg := $(eexe_dir)/tools_msg2cmsg
javac := javac
#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/usr/local/lib -L$(lib_dir) -lm -lrt
elinkflags := -O3 -L/usr/local/lib -L$(lib_dir) -L$(elib_dir) -lm -lrt
explinkflags := -g -L/usr/local/lib -L$(elib_dir) -lm -lrt
clis = /lis=$(list)
dolist = /lis=$(list)
domap = -Xlinker -Map -Xlinker $(map)
else
cflags := -c -g -Wall -D_GNU_SOURCE -D_REENTRANT -fPIC
cxxflags := $(cflags) -Wno-deprecated
mmflags := -Wno-deprecated
linkflags := -g -L/usr/local/lib -L$(lib_dir) -lm -lrt
elinkflags := -g -L/usr/local/lib -L$(lib_dir) -L$(elib_dir) -lm -lrt
explinkflags := -g -L/usr/local/lib -L$(elib_dir) -lm -lrt
dolist = /lis=$(list)
clis :=
domap = -Xlinker -Map -Xlinker $(map)
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
#!/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/
This diff is collapsed.
......@@ -148,6 +148,11 @@ sub build () # args: branch, subbranch, flavour, phase
exit 1;
}
use DB_File;
tie(%envdb, "DB_File", $dbname, O_CREAT|O_RDWR, 0644) || die "++ can't tie $dbname!";
read_vars();
my($branch) = $_[0];
if (!defined($branch)) {
usage_build();
......@@ -232,6 +237,10 @@ sub build_kernel # args: flavour
#
sub ebuild # args: pass flavour
{
use DB_File;
tie(%envdb, "DB_File", $dbname, O_CREAT|O_RDWR, 0644) || die "++ can't tie $dbname!";
read_vars();
my $fname = $ENV{"pwre_bin"} . "/ebuild.dat";
open FILE, $fname or die $!;
......@@ -1197,7 +1206,6 @@ sub tags ()
sub _build () # args: branch, subbranch, flavour, phase
{
my($branch) = $_[0];
if (!defined($branch)) {
usage_build();
......
#!/bin/bash
#
# Proview $Id: wb_gcg.sh,v 1.7 2008-06-02 14:58:42 claes Exp $
# Copyright (C) 2005 SSAB Oxelsund AB.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the program, if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# wb_gcg.sh -- compile and link PLC code
#
# This compiles a file generated by wb_gcg
# and inserts it in the plc library
# It is called from the wb_gcg.c module.
#
let gcg__success=0
let gcg__compileerrors=1
let gcg__linkerrors=2
let gcg__archiveerror=3
let gcg__rsherror=4
#
# MyRsh returns the return status from the compile command, not from rsh
# It only works on remote unix systems, not VMS...
#
MyRsh()
{
hostname=
lflag=
nflag=
user=
case $1 in
-l)
;;
*)
hostname=$1
shift
esac
case $1 in
-l)
lflag=-l
user=$2
shift 2
esac
case $1 in
-n)
nflag=-n
shift
esac
case $hostname in
'')
hostname=$1
shift
esac
case $# in
0)
exec /usr/ucb/rlogin $lflag ${user+"$user"} "$hostname"
esac
AWK='
NR > 1 {
print prev;
prev = $0;
prev1 = $1;
prev2 = $2;
}
NR == 1 {
prev = $0;
prev1 = $1;
prev2 = $2;
}
END {
if (prev1 ~ /[0-9]*[0-9]0/)
exit(prev1 / 10);
if (prev1 == "0")
exit(prev2);
print prev;
exit(1);
}
'
exec 3>&1
if rsh "$hostname" $lflag ${user+"$user"} $nflag \
"(${*-:}); sh -c '"'echo "$0 $1" >&2'\'' $?0 "$status"' \
2>&1 >&3 3>&- | awk "$AWK" >&2 3>&-
then
gcg_status=0
else
gcg_status=1
fi
}
CompileProcess()
{
if $cc_cmd -o $pwrp_obj/${FileName}.o $pwrp_gc/${FileName}.gc
then
echo "-- Plc process compiled for $OsStr $say_debug $ObjectName"
gcg_status=$gcg__success
else
echo "** Plc process compiled with errors $OsStr $ObjectName"
gcg_status=$gcg__compileerrors
fi
if [ $Debug -eq 0 ]; then
rm $pwrp_gc/${FileName}.gc
fi
}
CompileProgram()
{
if $cc_cmd -o $pwrp_obj/plc_m${FileName}.o $pwrp_gc/plc_m${FileName}.gc
then
echo "-- Plc plcpgm compiled for $OsStr $say_debug $ObjectName"
gcg_status=$gcg__success
else
echo "** Plc plcpgm compiled with errors $OsStr $ObjectName"
gcg_status=$gcg__compileerrors
fi
if [ $Debug -eq 0 ]; then
rm $pwrp_gc/plc_m${FileName}.gc
fi
}
CompileWindow()
{
if $cc_cmd -o $pwrp_obj/plc_m${FileName}.o $pwrp_gc/plc_m${FileName}.gc
then
echo "-- Plc window compiled for $OsStr $say_debug $ObjectName"
gcg_status=$gcg__success
else
echo "** Plc window compiled with errors for $OsStr $ObjectName"
gcg_status=$gcg__compileerrors
fi
if [ $Debug -eq 0 ]; then
rm $pwrp_gc/plc_m${FileName}.gc
rm $pwrp_gc/plc_dec${FileName}.gc
rm $pwrp_gc/plc_r1r${FileName}.gc
rm $pwrp_gc/plc_r2r${FileName}.gc
rm $pwrp_gc/plc_ref${FileName}.gc
rm $pwrp_gc/plc_cod${FileName}.gc
fi
}
CompileRtNode()
{
#link option file exists and is not empty
if [ -s $pwrp_exe/$FileName.opt ]; then
ld_opt_tmp="`cat $pwrp_exe/$FileName.opt`"
ld_opt="`eval echo $ld_opt_tmp`"
else
ld_opt="`eval echo $pwrobj/rt_io_user.o -lpwr_rt -lpwr_usbio_dummy`"
fi
if $cxx $link_debug -L/lib/thread -L$pwrp_lib -L$pwrp_cmn/arm_linux/lib -L$pwrlib \
-o $pwrp_exe/$OutFile \
$pwrobj/rt_plc_process.o \
$pwrp_obj/${FileName}.o \
$Libs \
$ld_opt \
$pwrobj/pwr_msg_rt.o $pwrobj/pwr_msg_co.o \
-lrt -lpwr_remote -lpwr_nmps -lpwr_rt -lpwr_co -lrpcsvc -lpwr_msg_dummy -lpthread -lm
then
echo "-- Plc program linked for $OsStr $say_linkdebug node $FileName"
gcg_status=$gcg__success
else
echo "** Plc program link errors for $OsStr node $FileName"
gcg_status=$gcg__linkerrors
fi
if [ -n "$pwrp_exe_target" ]; then
cp $pwrp_exe/$OutFile $pwrp_exe_target
echo "-- Plc copied to $pwrp_exe_target"
fi
}
CompileLibrary()
{
echo "-- Building archive for volume: $VolumeId"
cd $pwrp_obj
if $ar -rc $pwrp_lib/$PlcLib `ls plc_m${VolumeId}*.o`
then
echo "-- Archive built for volume: $VolumeId"
gcg_status=$gcg__success
else
echo "** Error builing archive for volume: $VolumeId"
gcg_status=$gcg__archiveerror
fi
}
OsMaskToOpSys ()
{
let BitM=$1
let Idx=0
let Val=1
while [ $Val -lt $BitM ]; do
let Val=$Val*2
let Idx=$Idx+1
done
let OpSys=Idx+1
}
#
#
#
# Main
#
#
#
# Arguments
#
let Debug="$1" # 1 if debug, 0 i nodebug
let FileType="$2" # the type of file: rtnode,
# plc or window module
FileName="$3" # the name of the file to be compiled,
VolumeId="$3" # VolumeId for objects to be inserted
let OsMask="$4" # pwr_mOpSys
OutFile="$5" # the name of the generated file
PlcLib="$5" # library for filetype Program and Windoow
Libs="$6" # link libraries
ObjectName="$6" # name of object
SystemName="$7" # name of system
ProjectRoot="$8" # project root
OsMaskToOpSys $OsMask # Convert Bitmask to index
#
# Local symbols
#
let OpSys__Low=0
let OpSys_CustomBuild=1
let OpSys_VAX_VMS=2
let OpSys_AXP_VMS=3
let OpSys_PPC_LYNX=4
let OpSys_X86_LYNX=5
let OpSys_PPC_LINUX=6
let OpSys_X86_LINUX=7
let OpSys_X86_64_LINUX=8
let OpSys_ARM_LINUX=9
let OpSys__High=10
vOpSys="custombuild,vax_vms,axp_vms,ppc_lynx,x86_lynx,ppc_linux,x86_linux,x86_64_linux,arm_linux"
let FileType__Low=-1
let FileType_Process=0
let FileType_Program=1
let FileType_Window=2
let FileType_RtNode=3
let FileType_Library=4
let FileType__High=5
vFileType="Process,Program,Window,RtNode,Library"
ar=arm-linux-gnueabi-ar
cc=arm-linux-gnueabi-gcc-4.3
cxx=arm-linux-gnueabi-g++-4.3
ldxx=arm-linux-gnueabi-g++-4.3
pwrinc=$pwrb_root/os_linux/hw_arm/exp/inc
pwrobj=$pwrb_root/os_linux/hw_arm/exp/obj
pwrlib=$pwrb_root/os_linux/hw_arm/exp/lib
local_setup="pwr_gcg_setup.sh"
if [ -e ${local_setup} ]; then
# echo "-- Local setup file used"
source ${local_setup} ${ProjectRoot} ${SystemName}
fi
if [ $Debug -eq 1 ]; then
cc_debug="-g"
link_debug="-g"
say_debug="with debug"
say_linkdebug="with debug"
else
cc_debug="-O3"
say_debug="optimized -O3"
say_linkdebug=""
fi
#
# Check OpSys
#
# Current opsys
machine=`eval uname -m`
if [ $machine = "x86_64" ]; then
CurrentOpSys=$OpSys_X86_64_LINUX
else
CurrentOpSys=$OpSys_X86_LINUX
fi
#
# Check FileType
#
if [ $FileType -le $FileType__Low ] || [ $FileType -ge $FileType__High ];
then
echo "Unknown file type: $FileType"
exit -1
fi
OsStr="`echo $vOpSys| cut -f $OpSys -d ,`"
let FileTypeIdx=$FileType+1
if [ $OpSys -eq $OpSys_PPC_LINUX ]; then
pwrp_gc="$pwrp_tmp"
# Suppress all warnings, -x
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
# Execute build command
Compile$FileTypeStr
exit $gcg_status
elif [ $OpSys -eq $OpSys_X86_LINUX ]; then
pwrp_gc="$pwrp_tmp"
# Suppress all warnings, -x
if [ $CurrentOpSys -eq $OpSys ]; then
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
# Execute build command
Compile$FileTypeStr
exit $gcg_status
elif [ $CurrentOpSys -eq $OpSys_X86_64_LINUX ]; then
echo "-- Not built for x86_linux"
fi
elif [ $OpSys -eq $OpSys_X86_64_LINUX ]; then
pwrp_gc="$pwrp_tmp"
# Suppress all warnings, -x
if [ $CurrentOpSys -eq $OpSys ]; then
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
# Execute build command
Compile$FileTypeStr
exit $gcg_status
elif [ $CurrentOpSys -eq $OpSys_X86_LINUX ]; then
echo "-- Not built for x86_64_linux"
fi
elif [ $OpSys -eq $OpSys_ARM_LINUX ]; then
pwrp_gc="$pwrp_tmp"
echo "-- Cross compilation ARM_LINUX"
# Suppress all warnings, -x
cc_cmd="$cc -c -x c -w $cc_debug -D_REENTRANT -DOS_LINUX -I$pwrinc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
# Execute build command
Compile$FileTypeStr
exit $gcg_status
elif [ $OpSys -eq $OpSys_AXP_VMS ]; then
rsh $pwr_build_host_axp_vms @pwr_exe:wb_gcg \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" \"$7\" \"$pwrp_root\"
exit $?
elif [ $OpSys -eq $OpSys_VAX_VMS ]; then
rsh $pwr_build_host_vax_vms @pwr_exe:wb_gcg \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" \"$7\" \"$pwrp_root\"
exit $?
elif [ $OpSys -eq $OpSys_X86_LYNX ]; then
MyRsh $pwr_build_host_x86_lynx '$pwr_exe/wb_gcg.sh' \"$1\" \"$2\" \"$3\" \"$4\" \"$5\" \"$6\" \"$7\" \"$pwrp_root\"
exit $gcg_status
elif [ $OpSys -eq $OpSys_CustomBuild ]; then
if [ -e $pwrp_exe/custom_build.sh ]; then
$pwrp_exe/custom_build.sh "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$pwrp_root"
exit $gcg_status
else
echo "Create \$pwrp_exe/custom_build.sh to build this volume"
exit $gcg_status
fi
else
echo "Unknown operating system: $OpSys"
exit -1
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