aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-09-19 13:13:59 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-09-19 13:13:59 +0000
commitabc25c283253082f33b9ad21f6aa966b3eb94192 (patch)
treeb362b7a0f4a219a3652042428d21a98b4780d318
parente50cf427fd6a5d782414cb93446d38c73dd97022 (diff)
automatic adding of new source-files to the main setup function
svn path=/trunk/externals/iem/iemmatrix/; revision=3593
-rw-r--r--src/iemmatrix.c82
-rw-r--r--src/iemmatrix_sources.c64
-rw-r--r--src/iemmatrix_sources.h62
-rwxr-xr-xsrc/makesource.sh65
4 files changed, 194 insertions, 79 deletions
diff --git a/src/iemmatrix.c b/src/iemmatrix.c
index fd884f6..8c7e1e2 100644
--- a/src/iemmatrix.c
+++ b/src/iemmatrix.c
@@ -13,91 +13,15 @@
*/
#include "iemmatrix.h"
-void mtx_mul_setup();
-void mtx_div_setup();
-void mtx_add_setup();
-void mtx_sub_setup();
-void mtx_pow_setup();
-void mtx_col_setup();
-void mtx_cholesky_setup();
-void mtx_dbtorms_setup();
-void mtx_rmstodb_setup();
-void mtx_diag_setup();
-void mtx_diegg_setup();
-void mtx_distance2_setup();
-void mtx_egg_setup();
-void mtx_element_setup();
-void mtx_exp_setup();
-void mtx_eye_setup();
-void mtx_gauss_setup();
-void mtx_inverse_setup();
-void mtx_log_setup();
-void mtx_matrix_setup();
-void mtx_mean_setup();
-void mtx_check_setup();
-void mtx_print_setup();
-void mtx_prod_setup();
-void mtx_ones_setup();
-void mtx_pivot_setup();
-void mtx_rand_setup();
-void mtx_resize_setup();
-void mtx_roll_setup();
-void mtx_row_setup();
-void mtx_scroll_setup();
-void mtx_size_setup();
-void mtx_sum_setup();
-void mtx_trace_setup();
-void mtx_transpose_setup();
-void mtx_zeros_setup();
-void mtx_mul_tilde_setup();
-
-void iemtx_setup(){
- mtx_mul_setup();
- mtx_div_setup();
- mtx_add_setup();
- mtx_sub_setup();
- mtx_pow_setup();
- mtx_col_setup();
- mtx_cholesky_setup();
- mtx_diag_setup();
- mtx_diegg_setup();
- mtx_distance2_setup();
- mtx_egg_setup();
- mtx_element_setup();
- mtx_exp_setup();
- mtx_eye_setup();
- mtx_gauss_setup();
- mtx_inverse_setup();
- mtx_log_setup();
- mtx_dbtorms_setup();
- mtx_rmstodb_setup();
- mtx_matrix_setup();
- mtx_mean_setup();
- mtx_check_setup();
- mtx_print_setup();
- mtx_prod_setup();
- mtx_ones_setup();
- mtx_pivot_setup();
- mtx_rand_setup();
- mtx_resize_setup();
- mtx_roll_setup();
- mtx_row_setup();
- mtx_scroll_setup();
- mtx_size_setup();
- mtx_sum_setup();
- mtx_trace_setup();
- mtx_transpose_setup();
- mtx_zeros_setup();
- mtx_mul_tilde_setup();
-}
+#include "iemmatrix_sources.c"
void iemmatrix_setup(){
post("");
post("iemmatrix "VERSION);
post("\tobjects for manipulating 2d-matrices");
- post("\t(c) IOhannes m zmölnig, Thomas Musil :: iem, 2001-2005");
+ post("\t(c) IOhannes m zmölnig, Thomas Musil, Franz Zotter :: iem, 2001-2005");
post("\tcompiled "__DATE__" : "__TIME__);
post("");
- iemtx_setup();
+ iemmatrix_sources_setup();
}
diff --git a/src/iemmatrix_sources.c b/src/iemmatrix_sources.c
new file mode 100644
index 0000000..ac902a2
--- /dev/null
+++ b/src/iemmatrix_sources.c
@@ -0,0 +1,64 @@
+/* iemmatrix-setup autogenerated setup-file
+ * generated by "./makesource.sh"
+ * !! DO NOT MANUALLY EDIT !!
+ */
+
+#include "iemmatrix_sources.h"
+
+void iemmatrix_sources_setup(void)
+{
+ iemtx_abs_setup(); /* mtx_abs.c */
+ iemtx_add_setup(); /* mtx_add.c */
+ iemtx_and_setup(); /* mtx_and.c */
+ iemtx_binops_setup(); /* mtx_binops.c */
+ iemtx_bitand_setup(); /* mtx_bitand.c */
+ iemtx_bitleft_setup(); /* mtx_bitleft.c */
+ iemtx_bitor_setup(); /* mtx_bitor.c */
+ iemtx_bitright_setup(); /* mtx_bitright.c */
+ iemtx_check_setup(); /* mtx_check.c */
+ iemtx_cholesky_setup(); /* mtx_cholesky.c */
+ iemtx_col_setup(); /* mtx_col.c */
+ iemtx_cos_setup(); /* mtx_cos.c */
+ iemtx_dbtorms_setup(); /* mtx_dbtorms.c */
+ iemtx_diag_setup(); /* mtx_diag.c */
+ iemtx_diegg_setup(); /* mtx_diegg.c */
+ iemtx_distance2_setup(); /* mtx_distance2.c */
+ iemtx_egg_setup(); /* mtx_egg.c */
+ iemtx_element_setup(); /* mtx_element.c */
+ iemtx_eq_setup(); /* mtx_eq.c */
+ iemtx_exp_setup(); /* mtx_exp.c */
+ iemtx_eye_setup(); /* mtx_eye.c */
+ iemtx_gauss_setup(); /* mtx_gauss.c */
+ iemtx_ge_setup(); /* mtx_ge.c */
+ iemtx_gt_setup(); /* mtx_gt.c */
+ iemtx_int_setup(); /* mtx_int.c */
+ iemtx_inverse_setup(); /* mtx_inverse.c */
+ iemtx_le_setup(); /* mtx_le.c */
+ iemtx_log_setup(); /* mtx_log.c */
+ iemtx_lt_setup(); /* mtx_lt.c */
+ iemtx_matrix_setup(); /* mtx_matrix.c */
+ iemtx_mean_setup(); /* mtx_mean.c */
+ iemtx_mul_setup(); /* mtx_mul.c */
+ iemtx_mul__setup(); /* mtx_mul~.c */
+ iemtx_neq_setup(); /* mtx_neq.c */
+ iemtx_ones_setup(); /* mtx_ones.c */
+ iemtx_or_setup(); /* mtx_or.c */
+ iemtx_pivot_setup(); /* mtx_pivot.c */
+ iemtx_pow_setup(); /* mtx_pow.c */
+ iemtx_print_setup(); /* mtx_print.c */
+ iemtx_prod_setup(); /* mtx_prod.c */
+ iemtx_rand_setup(); /* mtx_rand.c */
+ iemtx_resize_setup(); /* mtx_resize.c */
+ iemtx_rmstodb_setup(); /* mtx_rmstodb.c */
+ iemtx_roll_setup(); /* mtx_roll.c */
+ iemtx_row_setup(); /* mtx_row.c */
+ iemtx_scroll_setup(); /* mtx_scroll.c */
+ iemtx_sin_setup(); /* mtx_sin.c */
+ iemtx_size_setup(); /* mtx_size.c */
+ iemtx_sub_setup(); /* mtx_sub.c */
+ iemtx_sum_setup(); /* mtx_sum.c */
+ iemtx_trace_setup(); /* mtx_trace.c */
+ iemtx_transpose_setup(); /* mtx_transpose.c */
+ iemtx_zeros_setup(); /* mtx_zeros.c */
+}
+
diff --git a/src/iemmatrix_sources.h b/src/iemmatrix_sources.h
new file mode 100644
index 0000000..5223195
--- /dev/null
+++ b/src/iemmatrix_sources.h
@@ -0,0 +1,62 @@
+/* iemmatrix-setup autogenerated header-file
+ * generated by "./makesource.sh"
+ * !! DO NOT MANUALLY EDIT !!
+ */
+
+#ifndef IEMMATRIX_SOURCES_H__
+#define IEMMATRIX_SOURCES_H__
+void iemtx_abs_setup(void); /* mtx_abs.c */
+void iemtx_add_setup(void); /* mtx_add.c */
+void iemtx_and_setup(void); /* mtx_and.c */
+void iemtx_binops_setup(void); /* mtx_binops.c */
+void iemtx_bitand_setup(void); /* mtx_bitand.c */
+void iemtx_bitleft_setup(void); /* mtx_bitleft.c */
+void iemtx_bitor_setup(void); /* mtx_bitor.c */
+void iemtx_bitright_setup(void); /* mtx_bitright.c */
+void iemtx_check_setup(void); /* mtx_check.c */
+void iemtx_cholesky_setup(void); /* mtx_cholesky.c */
+void iemtx_col_setup(void); /* mtx_col.c */
+void iemtx_cos_setup(void); /* mtx_cos.c */
+void iemtx_dbtorms_setup(void); /* mtx_dbtorms.c */
+void iemtx_diag_setup(void); /* mtx_diag.c */
+void iemtx_diegg_setup(void); /* mtx_diegg.c */
+void iemtx_distance2_setup(void); /* mtx_distance2.c */
+void iemtx_egg_setup(void); /* mtx_egg.c */
+void iemtx_element_setup(void); /* mtx_element.c */
+void iemtx_eq_setup(void); /* mtx_eq.c */
+void iemtx_exp_setup(void); /* mtx_exp.c */
+void iemtx_eye_setup(void); /* mtx_eye.c */
+void iemtx_gauss_setup(void); /* mtx_gauss.c */
+void iemtx_ge_setup(void); /* mtx_ge.c */
+void iemtx_gt_setup(void); /* mtx_gt.c */
+void iemtx_int_setup(void); /* mtx_int.c */
+void iemtx_inverse_setup(void); /* mtx_inverse.c */
+void iemtx_le_setup(void); /* mtx_le.c */
+void iemtx_log_setup(void); /* mtx_log.c */
+void iemtx_lt_setup(void); /* mtx_lt.c */
+void iemtx_matrix_setup(void); /* mtx_matrix.c */
+void iemtx_mean_setup(void); /* mtx_mean.c */
+void iemtx_mul_setup(void); /* mtx_mul.c */
+void iemtx_mul__setup(void); /* mtx_mul~.c */
+void iemtx_neq_setup(void); /* mtx_neq.c */
+void iemtx_ones_setup(void); /* mtx_ones.c */
+void iemtx_or_setup(void); /* mtx_or.c */
+void iemtx_pivot_setup(void); /* mtx_pivot.c */
+void iemtx_pow_setup(void); /* mtx_pow.c */
+void iemtx_print_setup(void); /* mtx_print.c */
+void iemtx_prod_setup(void); /* mtx_prod.c */
+void iemtx_rand_setup(void); /* mtx_rand.c */
+void iemtx_resize_setup(void); /* mtx_resize.c */
+void iemtx_rmstodb_setup(void); /* mtx_rmstodb.c */
+void iemtx_roll_setup(void); /* mtx_roll.c */
+void iemtx_row_setup(void); /* mtx_row.c */
+void iemtx_scroll_setup(void); /* mtx_scroll.c */
+void iemtx_sin_setup(void); /* mtx_sin.c */
+void iemtx_size_setup(void); /* mtx_size.c */
+void iemtx_sub_setup(void); /* mtx_sub.c */
+void iemtx_sum_setup(void); /* mtx_sum.c */
+void iemtx_trace_setup(void); /* mtx_trace.c */
+void iemtx_transpose_setup(void); /* mtx_transpose.c */
+void iemtx_zeros_setup(void); /* mtx_zeros.c */
+#endif /* IEMMATRIX_SOURCES_H__ */
+
diff --git a/src/makesource.sh b/src/makesource.sh
new file mode 100755
index 0000000..8b634bb
--- /dev/null
+++ b/src/makesource.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+IEMMATRIX_H=iemmatrix_sources.h
+IEMMATRIX_C=iemmatrix_sources.c
+
+EGREP=egrep
+SED=sed
+LS=ls
+
+#################################
+## functions
+
+function head_h() {
+ echo "/* iemmatrix-setup autogenerated header-file"
+ echo " * generated by \"$0\""
+ echo " * !! DO NOT MANUALLY EDIT !!"
+ echo " */"
+ echo
+ echo "#ifndef IEMMATRIX_SOURCES_H__"
+ echo "#define IEMMATRIX_SOURCES_H__"
+}
+
+function foot_h() {
+ echo "#endif /* IEMMATRIX_SOURCES_H__ */"
+ echo ""
+}
+
+function head_c() {
+ echo "/* iemmatrix-setup autogenerated setup-file"
+ echo " * generated by \"$0\""
+ echo " * !! DO NOT MANUALLY EDIT !!"
+ echo " */"
+ echo
+ echo "#include \"$IEMMATRIX_H\""
+ echo
+ echo "void iemmatrix_sources_setup(void)"
+ echo "{"
+}
+
+function foot_c() {
+ echo "}"
+ echo
+}
+
+
+##################################
+## body
+
+head_h > $IEMMATRIX_H
+head_c > $IEMMATRIX_C
+
+for i in $(${LS} *.c | ${EGREP} -v "iemmatrix.*\.c")
+do
+## each c-file in iemmatrix needs to have an ie<file>_setup()-function
+## that calls all needed setup-functions
+## any non-alpha-numeric-character is replaced by "_"
+## e.g. "multiplex~.c" -> "z_multiplex__setup()"
+ SETUPNAME=ie$(echo ${i%.c} | ${SED} -e 's/[^[:alnum:]]/_/g')_setup
+ echo "void ${SETUPNAME}(void); /* $i */" >> $IEMMATRIX_H
+ echo " ${SETUPNAME}(); /* $i */" >> $IEMMATRIX_C
+done
+
+foot_h >> $IEMMATRIX_H
+foot_c >> $IEMMATRIX_C
+