diff options
author | Josh Blum <josh@joshknows.com> | 2011-04-26 21:55:48 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-04-26 21:55:48 -0700 |
commit | a5e2d9e5baf869ae961fbb5820447290d6d9c7c8 (patch) | |
tree | 41ced4de13a41dd7b05a4e08d1a730cf0f079f7c | |
parent | d941ba31677804fe382d76fca17fc044d12777f5 (diff) |
volk: reorganization of generation sources and generated files
All generation sources have been moved to the gen/ subdirectory.
Bootstrap and volk_register.py generate the files into to gen/ subdirectory
in an effort to cleanly separate the static/generated parts of the build tree.
Define top_gendir in Makefile.common, all generated sources listed in Makefile.ams
are prefixed with $(top_gendir) to differentiate them from static in-tree sources.
-rw-r--r-- | volk/Makefile.am | 4 | ||||
-rw-r--r-- | volk/Makefile.common | 2 | ||||
-rwxr-xr-x | volk/bootstrap | 6 | ||||
-rw-r--r-- | volk/config/Makefile.am | 2 | ||||
-rw-r--r-- | volk/gen/.gitignore | 3 | ||||
-rw-r--r-- | volk/gen/archs.xml (renamed from volk/include/volk/archs.xml) | 0 | ||||
-rw-r--r-- | volk/gen/emit_omnilog.py (renamed from volk/include/volk/emit_omnilog.py) | 0 | ||||
-rw-r--r-- | volk/gen/machines.xml (renamed from volk/include/volk/machines.xml) | 0 | ||||
-rw-r--r-- | volk/gen/make_c.py (renamed from volk/include/volk/make_c.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_config_fixed.py (renamed from volk/include/volk/make_config_fixed.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_config_in.py (renamed from volk/include/volk/make_config_in.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_cpuid_c.py (renamed from volk/include/volk/make_cpuid_c.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_cpuid_h.py (renamed from volk/include/volk/make_cpuid_h.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_each_machine_c.py (renamed from volk/include/volk/make_each_machine_c.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_environment_init_c.py (renamed from volk/include/volk/make_environment_init_c.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_environment_init_h.py (renamed from volk/include/volk/make_environment_init_h.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_h.py (renamed from volk/include/volk/make_h.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_machines_c.py (renamed from volk/include/volk/make_machines_c.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_machines_h.py (renamed from volk/include/volk/make_machines_h.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_makefile_am.py (renamed from volk/include/volk/make_makefile_am.py) | 26 | ||||
-rw-r--r-- | volk/gen/make_proccpu_sim.py (renamed from volk/include/volk/make_proccpu_sim.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_registry.py (renamed from volk/include/volk/make_registry.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_set_simd.py (renamed from volk/include/volk/make_set_simd.py) | 0 | ||||
-rw-r--r-- | volk/gen/make_typedefs.py (renamed from volk/include/volk/make_typedefs.py) | 0 | ||||
-rw-r--r-- | volk/gen/volk_regexp.py (renamed from volk/include/volk/volk_regexp.py) | 0 | ||||
-rwxr-xr-x | volk/gen/volk_register.py (renamed from volk/include/volk/volk_register.py) | 56 | ||||
-rw-r--r-- | volk/include/volk/.gitignore | 15 | ||||
-rw-r--r-- | volk/include/volk/Makefile.am | 28 | ||||
-rw-r--r-- | volk/lib/.gitignore | 14 |
29 files changed, 62 insertions, 94 deletions
diff --git a/volk/Makefile.am b/volk/Makefile.am index cf55c76fa5..829c37b783 100644 --- a/volk/Makefile.am +++ b/volk/Makefile.am @@ -38,7 +38,6 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = volk.pc distclean-local: - -rm -f config/lv_set_simd_flags.m4 -rm -rf autom4te.cache -rm -f config.* -rm -f depcomp @@ -61,3 +60,6 @@ distclean-local: -rm -f configure -rm -f orc/Makefile.in -rm -f orc/*.c + -rm -rf gen/config + -rm -rf gen/include + -rm -rf gen/lib diff --git a/volk/Makefile.common b/volk/Makefile.common index 2184f33751..b9949cb333 100644 --- a/volk/Makefile.common +++ b/volk/Makefile.common @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +#define gendir for files generated during bootstrap +top_gendir = $(top_srcdir)/gen ourincludedir = $(includedir)/volk diff --git a/volk/bootstrap b/volk/bootstrap index ff239c88c1..a7fb78ac5e 100755 --- a/volk/bootstrap +++ b/volk/bootstrap @@ -20,8 +20,10 @@ # Boston, MA 02110-1301, USA. rm -fr config.cache autom4te*.cache -cd include/volk && chmod +x volk_register.py && ./volk_register.py && cd ../.. -aclocal -I config +python -B gen/volk_register.py +mv gen/lib/Makefile.am lib/ + +aclocal -I config -I gen/config autoconf autoheader libtoolize --automake diff --git a/volk/config/Makefile.am b/volk/config/Makefile.am index e5b7281e63..d4786f83a4 100644 --- a/volk/config/Makefile.am +++ b/volk/config/Makefile.am @@ -42,7 +42,7 @@ m4macros = \ lf_cxx.m4 \ lf_warnings.m4 \ lf_x11.m4 \ - lv_set_simd_flags.m4 \ + $(top_gendir)/config/lv_set_simd_flags.m4 \ mkstemp.m4 \ onceonly.m4 \ pkg.m4 \ diff --git a/volk/gen/.gitignore b/volk/gen/.gitignore new file mode 100644 index 0000000000..a1c468f93c --- /dev/null +++ b/volk/gen/.gitignore @@ -0,0 +1,3 @@ +/config +/include +/lib diff --git a/volk/include/volk/archs.xml b/volk/gen/archs.xml index 977cc79248..977cc79248 100644 --- a/volk/include/volk/archs.xml +++ b/volk/gen/archs.xml diff --git a/volk/include/volk/emit_omnilog.py b/volk/gen/emit_omnilog.py index 309d7e5789..309d7e5789 100644 --- a/volk/include/volk/emit_omnilog.py +++ b/volk/gen/emit_omnilog.py diff --git a/volk/include/volk/machines.xml b/volk/gen/machines.xml index ad71da177f..ad71da177f 100644 --- a/volk/include/volk/machines.xml +++ b/volk/gen/machines.xml diff --git a/volk/include/volk/make_c.py b/volk/gen/make_c.py index 591e8b64cd..591e8b64cd 100644 --- a/volk/include/volk/make_c.py +++ b/volk/gen/make_c.py diff --git a/volk/include/volk/make_config_fixed.py b/volk/gen/make_config_fixed.py index 3fd1bdf0aa..3fd1bdf0aa 100644 --- a/volk/include/volk/make_config_fixed.py +++ b/volk/gen/make_config_fixed.py diff --git a/volk/include/volk/make_config_in.py b/volk/gen/make_config_in.py index d29680af21..d29680af21 100644 --- a/volk/include/volk/make_config_in.py +++ b/volk/gen/make_config_in.py diff --git a/volk/include/volk/make_cpuid_c.py b/volk/gen/make_cpuid_c.py index 20621769b8..20621769b8 100644 --- a/volk/include/volk/make_cpuid_c.py +++ b/volk/gen/make_cpuid_c.py diff --git a/volk/include/volk/make_cpuid_h.py b/volk/gen/make_cpuid_h.py index cd3da24558..cd3da24558 100644 --- a/volk/include/volk/make_cpuid_h.py +++ b/volk/gen/make_cpuid_h.py diff --git a/volk/include/volk/make_each_machine_c.py b/volk/gen/make_each_machine_c.py index 94d6d77894..94d6d77894 100644 --- a/volk/include/volk/make_each_machine_c.py +++ b/volk/gen/make_each_machine_c.py diff --git a/volk/include/volk/make_environment_init_c.py b/volk/gen/make_environment_init_c.py index 263d5bcd13..263d5bcd13 100644 --- a/volk/include/volk/make_environment_init_c.py +++ b/volk/gen/make_environment_init_c.py diff --git a/volk/include/volk/make_environment_init_h.py b/volk/gen/make_environment_init_h.py index 77a841a246..77a841a246 100644 --- a/volk/include/volk/make_environment_init_h.py +++ b/volk/gen/make_environment_init_h.py diff --git a/volk/include/volk/make_h.py b/volk/gen/make_h.py index 07e62939bd..07e62939bd 100644 --- a/volk/include/volk/make_h.py +++ b/volk/gen/make_h.py diff --git a/volk/include/volk/make_machines_c.py b/volk/gen/make_machines_c.py index 9ad56fb628..9ad56fb628 100644 --- a/volk/include/volk/make_machines_c.py +++ b/volk/gen/make_machines_c.py diff --git a/volk/include/volk/make_machines_h.py b/volk/gen/make_machines_h.py index 674ee12cd3..674ee12cd3 100644 --- a/volk/include/volk/make_machines_h.py +++ b/volk/gen/make_machines_h.py diff --git a/volk/include/volk/make_makefile_am.py b/volk/gen/make_makefile_am.py index 2ff492b348..0d746ca28c 100644 --- a/volk/include/volk/make_makefile_am.py +++ b/volk/gen/make_makefile_am.py @@ -25,7 +25,7 @@ def make_makefile_am(dom, machines, archflags_dict): include $(top_srcdir)/Makefile.common AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) \ - -I$(top_builddir)/include \ + -I$(top_gendir)/include \ -Dvolk_EXPORTS \ -fvisibility=hidden \ $(WITH_INCLUDES) @@ -43,10 +43,10 @@ EXTRA_DIST = \ libvolk_la_SOURCES = \ $(platform_CODE) \ - volk.cc \ - volk_cpu.c \ + $(top_gendir)/lib/volk.cc \ + $(top_gendir)/lib/volk_cpu.c \ volk_rank_archs.c \ - volk_machines.cc + $(top_gendir)/lib/volk_machines.cc if LV_HAVE_ORC volk_orc_CFLAGS = -DLV_HAVE_ORC=1 @@ -69,8 +69,8 @@ noinst_LTLIBRARIES = #here be dragons for machine_name in machines: tempstring += "if LV_MACHINE_" + machine_name.swapcase() + "\n" - tempstring += "libvolk_" + machine_name + "_la_SOURCES = volk_machine_" + machine_name + ".cc\n" - tempstring += "libvolk_" + machine_name + "_la_CPPFLAGS = -I$(top_srcdir)/include $(volk_orc_CFLAGS) " + tempstring += "libvolk_" + machine_name + "_la_SOURCES = $(top_gendir)/lib/volk_machine_" + machine_name + ".cc\n" + tempstring += "libvolk_" + machine_name + "_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_gendir)/include $(volk_orc_CFLAGS) " for arch in machines[machine_name]: if archflags_dict[arch] != "none": tempstring += "-" + archflags_dict[arch] + " " @@ -99,7 +99,7 @@ noinst_LTLIBRARIES = # headers that don't get installed # ---------------------------------------------------------------- noinst_HEADERS = \ - volk_init.h \ + $(top_gendir)/lib/volk_init.h \ qa_utils.h # ---------------------------------------------------------------- @@ -113,18 +113,6 @@ testqa_CPPFLAGS = -DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN $(AM_CPPFLAGS) testqa_LDFLAGS = $(BOOST_UNIT_TEST_FRAMEWORK_LIB) testqa_LDADD = \ libvolk.la - -distclean-local: - rm -f volk.c - rm -f volk_cpu_generic.c - rm -f volk_cpu_powerpc.c - rm -f volk_cpu_x86.c - rm -f volk_init.c - rm -f volk_init.h - rm -f volk_mktables.c - rm -f volk_proccpu_sim.c - rm -f volk_tables.h - rm -f volk_environment_init.c """ diff --git a/volk/include/volk/make_proccpu_sim.py b/volk/gen/make_proccpu_sim.py index 029dacfcc0..029dacfcc0 100644 --- a/volk/include/volk/make_proccpu_sim.py +++ b/volk/gen/make_proccpu_sim.py diff --git a/volk/include/volk/make_registry.py b/volk/gen/make_registry.py index de1f46aa64..de1f46aa64 100644 --- a/volk/include/volk/make_registry.py +++ b/volk/gen/make_registry.py diff --git a/volk/include/volk/make_set_simd.py b/volk/gen/make_set_simd.py index 5a848e59ea..5a848e59ea 100644 --- a/volk/include/volk/make_set_simd.py +++ b/volk/gen/make_set_simd.py diff --git a/volk/include/volk/make_typedefs.py b/volk/gen/make_typedefs.py index 8f9f2b55e0..8f9f2b55e0 100644 --- a/volk/include/volk/make_typedefs.py +++ b/volk/gen/make_typedefs.py diff --git a/volk/include/volk/volk_regexp.py b/volk/gen/volk_regexp.py index b83ce5206c..b83ce5206c 100644 --- a/volk/include/volk/volk_regexp.py +++ b/volk/gen/volk_regexp.py diff --git a/volk/include/volk/volk_register.py b/volk/gen/volk_register.py index 9b7ca73f9c..19fc61c159 100755 --- a/volk/include/volk/volk_register.py +++ b/volk/gen/volk_register.py @@ -1,6 +1,7 @@ #! /usr/bin/env python import sys +import os import re import string from xml.dom import minidom @@ -21,23 +22,36 @@ from make_c import make_c from make_h import make_h import copy -outfile_set_simd = open("../../config/lv_set_simd_flags.m4", "w"); -outfile_reg = open("volk_registry.h", "w"); -outfile_h = open("volk.h", "w"); -outfile_c = open("../../lib/volk.cc", "w"); -outfile_typedefs = open("volk_typedefs.h", "w"); -outfile_init_h = open("../../lib/volk_init.h", "w"); -outfile_cpu_h = open("volk_cpu.h", "w"); -outfile_cpu_c = open("../../lib/volk_cpu.c", "w"); -#outfile_config_in = open("../../volk_config.h.in", "w"); -outfile_config_fixed = open("volk_config_fixed.h", "w"); -#outfile_mktables = open("../../lib/volk_mktables.c", "w"); -outfile_environment_c = open("../../lib/volk_environment_init.c", "w"); -outfile_environment_h = open("volk_environment_init.h", "w"); -outfile_makefile_am = open("../../lib/Makefile.am", "w"); -outfile_machines_h = open("volk_machines.h", "w"); -outfile_machines_c = open("../../lib/volk_machines.cc", "w"); -infile = open("Makefile.am", "r"); +#set srcdir and gendir +srcdir = os.path.dirname(os.path.dirname(__file__)) +try: gendir = sys.argv[1] +except: gendir = os.path.dirname(__file__) + +#ensure directories exist +for dir in ( + (os.path.join(gendir, 'include', 'volk')), + (os.path.join(gendir, 'lib')), + (os.path.join(gendir, 'config')) +): + if not os.path.exists(dir): os.makedirs(dir) + +outfile_set_simd = open(os.path.join(gendir, "config/lv_set_simd_flags.m4"), "w") +outfile_reg = open(os.path.join(gendir, "include/volk/volk_registry.h"), "w") +outfile_h = open(os.path.join(gendir, "include/volk/volk.h"), "w") +outfile_c = open(os.path.join(gendir, "lib/volk.cc"), "w") +outfile_typedefs = open(os.path.join(gendir, "include/volk/volk_typedefs.h"), "w") +outfile_init_h = open(os.path.join(gendir, "lib/volk_init.h"), "w") +outfile_cpu_h = open(os.path.join(gendir, "include/volk/volk_cpu.h"), "w") +outfile_cpu_c = open(os.path.join(gendir, "lib/volk_cpu.c"), "w") +#outfile_config_in = open(os.path.join(gendir, "include/volk/volk_config.h.in"), "w") +outfile_config_fixed = open(os.path.join(gendir, "include/volk/volk_config_fixed.h"), "w") +#outfile_mktables = open(os.path.join(gendir, "lib/volk_mktables.c"), "w") +outfile_environment_c = open(os.path.join(gendir, "lib/volk_environment_init.c"), "w") +outfile_environment_h = open(os.path.join(gendir, "include/volk/volk_environment_init.h"), "w") +outfile_makefile_am = open(os.path.join(gendir, "lib/Makefile.am"), "w") +outfile_machines_h = open(os.path.join(gendir, "include/volk/volk_machines.h"), "w") +outfile_machines_c = open(os.path.join(gendir, "lib/volk_machines.cc"), "w") +infile = open(os.path.join(srcdir, "include/volk/Makefile.am"), "r") mfile = infile.readlines(); @@ -70,7 +84,7 @@ for line in mfile: functions.append(subsubline.group(0)); archs = []; -afile = minidom.parse("archs.xml"); +afile = minidom.parse(os.path.join(srcdir, "gen/archs.xml")) filearchs = afile.getElementsByTagName("arch"); for filearch in filearchs: archs.append(str(filearch.attributes["name"].value)); @@ -94,7 +108,7 @@ archs_or = archs_or + ")"; #get machine list and parse to a list of machines, each with a list of archs (none of this DOM crap) machine_str_dict = {} -mfile = minidom.parse("machines.xml"); +mfile = minidom.parse(os.path.join(srcdir, "gen/machines.xml")) filemachines = mfile.getElementsByTagName("machine") for filemachine in filemachines: @@ -136,7 +150,7 @@ my_argtypelist = []; for func in functions: tags = []; fcount = []; - infile_source = open(func + ".h"); + infile_source = open(os.path.join(srcdir, 'include', 'volk', func + ".h")) begun_name = 0; begun_paren = 0; sourcefile = infile_source.readlines(); @@ -285,7 +299,7 @@ outfile_h.write(make_h(functions, arched_arglist)) outfile_h.close() for machine in machines: - machine_c_filename = "../../lib/volk_machine_" + machine + ".cc" + machine_c_filename = os.path.join(gendir, "lib/volk_machine_" + machine + ".cc") outfile_machine_c = open(machine_c_filename, "w") outfile_machine_c.write(make_each_machine_c(machine, machines[machine], functions, fcountlist, taglist)) outfile_machine_c.close() diff --git a/volk/include/volk/.gitignore b/volk/include/volk/.gitignore index 1afe439ba2..b336cc7cec 100644 --- a/volk/include/volk/.gitignore +++ b/volk/include/volk/.gitignore @@ -1,17 +1,2 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo /Makefile /Makefile.in -/volk.h -/volk_config_fixed.h -/volk_cpu.h -/volk_environment_init.h -/volk_registry.h -/volk_typedefs.h -/volk_machines.h diff --git a/volk/include/volk/Makefile.am b/volk/include/volk/Makefile.am index b36d96c5db..ea60d201a1 100644 --- a/volk/include/volk/Makefile.am +++ b/volk/include/volk/Makefile.am @@ -29,13 +29,13 @@ volkinclude_HEADERS = \ volk_attributes.h \ volk_complex.h \ volk_common.h \ - volk_config_fixed.h \ - volk_typedefs.h \ - volk_registry.h \ - volk.h \ - volk_cpu.h \ - volk_machines.h \ - volk_environment_init.h \ + $(top_gendir)/include/volk/volk_config_fixed.h \ + $(top_gendir)/include/volk/volk_typedefs.h \ + $(top_gendir)/include/volk/volk_registry.h \ + $(top_gendir)/include/volk/volk.h \ + $(top_gendir)/include/volk/volk_cpu.h \ + $(top_gendir)/include/volk/volk_machines.h \ + $(top_gendir)/include/volk/volk_environment_init.h \ volk_16i_x5_add_quad_16i_x4_a16.h \ volk_16i_branch_4_state_8_a16.h \ volk_16ic_deinterleave_16i_x2_a16.h \ @@ -124,17 +124,3 @@ volkinclude_HEADERS = \ volk_8i_convert_16i_u.h \ volk_8i_s32f_convert_32f_a16.h \ volk_8i_s32f_convert_32f_u.h - -distclean-local: - rm -f volk_config_fixed.h - rm -f volk_cpu.h - rm -f volk.h - rm -f volk_registry.h - rm -f volk_runtime.h - rm -f volk_typedefs.h - rm -f volk_tables.h - rm -f *.pyc - rm -f Makefile.in - rm -f volk_environment_init.h - rm -f volk_mktables - rm -f $(BUILT_SOURCES) diff --git a/volk/lib/.gitignore b/volk/lib/.gitignore index c676a61df0..28ec6ddaa9 100644 --- a/volk/lib/.gitignore +++ b/volk/lib/.gitignore @@ -1,18 +1,4 @@ -/*.cache -/*.la -/*.lo -/*.pc -/.deps -/.la -/.libs -/.lo /Makefile /Makefile.in /Makefile.am -/volk_environment_init.c -/volk_init.h /testqa -/volk.cc -/volk_cpu.c -/volk_machine_*.cc -/volk_machines.cc |