Browse code

- new files needed by the improved build system

Andrei Pelinescu-Onciul authored on 28/06/2008 00:36:56
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,20 @@
0
+#
1
+# $Id$
2
+#
3
+# remake cfg defs (include)
4
+#
5
+# depends on COREPATH being defined 
6
+#
7
+# History:
8
+# --------
9
+#  2008-06-27  initial version (andrei)
10
+#
11
+
12
+
13
+#create config if needed
14
+$(COREPATH)/config.mak: makefile_defs=0
15
+$(COREPATH)/config.mak: exported_vars=0
16
+
17
+$(COREPATH)/config.mak: $(COREPATH)/Makefile.defs
18
+	$(MAKE) -wC $(COREPATH) cfg
19
+
0 20
new file mode 100644
... ...
@@ -0,0 +1,35 @@
0
+#
1
+# $Id$
2
+#
3
+# shared functions 
4
+#
5
+#
6
+# History:
7
+# --------
8
+#  2008-06-27  initial version (andrei)
9
+#
10
+
11
+escape_values=$(subst $$,\$$,$(subst ",\", $(1)))
12
+
13
+# generates echo "$(1)=escape($(1))"
14
+cfg_gen_var=echo "$(1)=$(call escape_values,$($(1)))"
15
+
16
+# similar to cfg_gen_var, but for FOO=1 var=$(FOO)
17
+# it would generate "echo var=$(FOO)" and not "echo var=1"
18
+cfg_gen_var2=echo "$(1)=$(call escape_values,$(value $(1)))"
19
+
20
+# generates echo "$(1)=escape($(1)) >> $(2)"
21
+cfg_save_var=$(call cfg_gen_var,$(1)) >>$(2);
22
+# same as above but uses cfg_gen_var2
23
+cfg_save_var2=$(call cfg_gen_var2,$(1)) >>$(2);
24
+
25
+# map function $(1) on variable list $($(2)) (the function is used with only
26
+# one arg)
27
+mapf1=$(foreach v,$($(2)),$(call $(1),$v))
28
+# map function $(1) on variable list $($(2)), passing also $(3) as second
29
+# arg
30
+mapf2=$(foreach v,$($(2)),$(call $(1),$v,$(3)))
31
+
32
+
33
+#cfg_fixed_to_file=$(call mapf2,cfg_save_var,saved_fixed_vars,$(1))
34
+#cfg_chg_to_file=$(call mapf2,cfg_save_var2,saved_chg_vars,$(1))