From 52d1b0e8aaa5efbb92d8c1c80b843d2c4212f525 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 5 Sep 1991 11:33:24 +0000 Subject: [PATCH] New installation mechanism --- util/ceg/defaults/.distr | 2 +- util/ceg/defaults/m_C_mnem | 7 ++-- util/ceg/defaults/m_C_mnem_na | 5 +-- util/ceg/defaults/mk_C_out | 2 +- util/ceg/defaults/proto.make | 67 +++++++++++++++++++++++++++++++++++ 5 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 util/ceg/defaults/proto.make diff --git a/util/ceg/defaults/.distr b/util/ceg/defaults/.distr index e6653c9af..9145090bf 100644 --- a/util/ceg/defaults/.distr +++ b/util/ceg/defaults/.distr @@ -1,4 +1,4 @@ -Makefile +proto.make READ_ME message not_impl diff --git a/util/ceg/defaults/m_C_mnem b/util/ceg/defaults/m_C_mnem index 68aaf9d07..19810bb3b 100755 --- a/util/ceg/defaults/m_C_mnem +++ b/util/ceg/defaults/m_C_mnem @@ -1,8 +1,9 @@ -EM_TABLE=../../../etc/em_table +EM_TABLE=$1 +argtype=$2 echo "switch(p->em_opcode) {" for i in - cdflnorswz p b do - list=`./argtype $i $EM_TABLE` + list=`$argtype $i $EM_TABLE` case $i in -) args='()' echo " /* no arguments */" @@ -32,7 +33,7 @@ do EOF done done -list=`./argtype g $EM_TABLE` +list=`$argtype g $EM_TABLE` cat << 'EOF' default: /* a "g" argument */ diff --git a/util/ceg/defaults/m_C_mnem_na b/util/ceg/defaults/m_C_mnem_na index 7f1af2964..0aa67c050 100755 --- a/util/ceg/defaults/m_C_mnem_na +++ b/util/ceg/defaults/m_C_mnem_na @@ -1,5 +1,6 @@ -EM_TABLE=../../../etc/em_table -list=`./argtype w $EM_TABLE` +EM_TABLE=$1 +argtype=$2 +list=`$argtype w $EM_TABLE` echo "switch(p->em_opcode) {" for i in $list do diff --git a/util/ceg/defaults/mk_C_out b/util/ceg/defaults/mk_C_out index b8ed811d6..e6cc5370b 100755 --- a/util/ceg/defaults/mk_C_out +++ b/util/ceg/defaults/mk_C_out @@ -1,5 +1,5 @@ trap "rm -f tmp$$" 0 1 2 3 15 -cp C_out_skel.c tmp$$ +cp $1 tmp$$ ed - tmp$$ <<'EOF' /^#include "C_mnem_narg"/d .-1r C_mnem_narg diff --git a/util/ceg/defaults/proto.make b/util/ceg/defaults/proto.make new file mode 100644 index 000000000..3f4921a46 --- /dev/null +++ b/util/ceg/defaults/proto.make @@ -0,0 +1,67 @@ +# $Header$ + +#PARAMS do not remove this line! + +SRC_DIR = $(SRC_HOME)/util/ceg/defaults + +CEGLIB = $(TARGET_HOME)/lib.bin/ceg +DEF = $(CEGLIB)/defaults +MessageList = C_cst.c C_dlb.c C_dnam.c C_fcon.c C_icon.c C_ilb.c C_mes_begin.c \ + C_mes_end.c C_pnam.c C_scon.c C_ucon.c +NotimplList = not_impl.c not_impl_table +PseudoList = C_busy.c C_close.c C_df_dlb.c C_df_dnam.c C_df_ilb.c C_end.c \ + C_end_narg.c C_exa_dlb.c C_exa_dnam.c C_exp.c C_ina_dlb.c \ + C_ina_dnam.c C_init.c C_inp.c C_magic.c C_open.c C_pro.c \ + C_pro_narg.c C_insertpart.c +StorageList = C_bss_cst.c C_bss_dlb.c C_bss_dnam.c C_bss_ilb.c C_bss_pnam.c \ + C_con_cst.c C_con_dlb.c C_con_dnam.c C_con_ilb.c C_con_pnam.c \ + C_con_scon.c C_hol_cst.c C_hol_dlb.c C_hol_dnam.c C_hol_ilb.c \ + C_hol_pnam.c C_rom_cst.c C_rom_dlb.c C_rom_dnam.c C_rom_ilb.c \ + C_rom_pnam.c C_rom_scon.c + +all: C_out.c + +clean: + rm -f C_out.c C_mnem C_mnem_narg + +install: all + -mkdir $(CEGLIB) + -mkdir $(DEF) + -mkdir $(DEF)/message + -mkdir $(DEF)/not_impl + -mkdir $(DEF)/pseudo + -mkdir $(DEF)/storage + cp $(SRC_DIR)/pseudo_vars.c $(DEF) + cp $(SRC_DIR)/EM_vars.c $(DEF) + for i in $(MessageList) ; do cp $(SRC_DIR)/message/$$i $(DEF)/message/$$i ; done + for i in $(NotimplList) ; do cp $(SRC_DIR)/not_impl/$$i $(DEF)/not_impl/$$i ; done + for i in $(PseudoList) ; do cp $(SRC_DIR)/pseudo/$$i $(DEF)/pseudo/$$i ; done + for i in $(StorageList) ; do cp $(SRC_DIR)/storage/$$i $(DEF)/storage/$$i ; done + cp C_out.c $(DEF)/C_out.c + +cmp: all + -cmp $(SRC_DIR)/pseudo_vars.c $(DEF)/pseudo_vars.c + -cmp $(SRC_DIR)/EM_vars.c $(DEF)/EM_vars.c + -for i in $(MessageList) ; do cmp $(SRC_DIR)/message/$$i $(DEF)/message/$$i ; done + -for i in $(NotimplList) ; do cmp $(SRC_DIR)/not_impl/$$i $(DEF)/not_impl/$$i ; done + -for i in $(PseudoList) ; do cmp $(SRC_DIR)/pseudo/$$i $(DEF)/pseudo/$$i ; done + -for i in $(StorageList) ; do cmp $(SRC_DIR)/storage/$$i $(DEF)/storage/$$i ; done + -cmp C_out.c $(DEF)/C_out.c + +pr: + @for i in $(MessageList) ; do pr $(SRC_DIR)/message/$$i ; done + @for i in $(NotimplList) ; do pr $(SRC_DIR)/not_impl/$$i ; done + @for i in $(PseudoList) ; do pr $(SRC_DIR)/pseudo/$$i ; done + @for i in $(StorageList) ; do pr $(SRC_DIR)/storage/$$i ; done + +opr: + make pr | opr + +C_out.c: $(SRC_DIR)/C_out_skel.c C_mnem C_mnem_narg $(SRC_DIR)/mk_C_out + $(SRC_DIR)/mk_C_out $(SRC_DIR)/C_out_skel.c > C_out.c + +C_mnem: $(SRC_DIR)/m_C_mnem $(SRC_DIR)/argtype + sh $(SRC_DIR)/m_C_mnem $(SRC_HOME)/etc/em_table $(SRC_DIR)/argtype > C_mnem + +C_mnem_narg: $(SRC_DIR)/m_C_mnem_na $(SRC_DIR)/argtype + sh $(SRC_DIR)/m_C_mnem_na $(SRC_HOME)/etc/em_table $(SRC_DIR)/argtype > C_mnem_narg