Merged r11491:11494 from jcorgan/pmt into trunk.
[debian/gnuradio] / gruel / src / lib / pmt / Makefile.am
1 #
2 # Copyright 2008,2009 Free Software Foundation, Inc.
3
4 # This file is part of GNU Radio
5
6 # GNU Radio is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3, or (at your option)
9 # any later version.
10
11 # GNU Radio is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Radio; see the file COPYING.  If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street,
19 # Boston, MA 02110-1301, USA.
20
21
22 include $(top_srcdir)/Makefile.common
23
24 AM_CPPFLAGS = $(DEFINES) $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(GRUEL_INCLUDES) $(WITH_INCLUDES)
25
26 TESTS = test_pmt
27
28 noinst_LTLIBRARIES = libpmt.la
29
30 # ----------------------------------------------------------------
31 # these scripts generate code
32
33 code_generator =                        \
34         generate_unv.py                 \
35         unv_template.h.t                \
36         unv_template.cc.t               \
37         unv_qa_template.cc.t            
38
39 GENERATED_H =                           \
40         pmt_unv_int.h                   \
41         qa_pmt_unv.h                    
42
43 GENERATED_CC =                          \
44         pmt_unv.cc                      \
45         qa_pmt_unv.cc                   
46
47 python_built_sources = $(GENERATED_H) $(GENERATED_CC)
48
49 PMT_SERIAL_TAGS_H = $(abs_top_builddir)/gruel/src/include/gruel/pmt_serial_tags.h
50 BUILT_SOURCES = $(python_built_sources) $(PMT_SERIAL_TAGS_H)
51
52 EXTRA_DIST = $(code_generator)
53
54 # ----------------------------------------------------------------
55
56 libpmt_la_SOURCES =                     \
57         pmt.cc                          \
58         pmt_io.cc                       \
59         pmt_pool.cc                     \
60         pmt_serialize.cc                \
61         pmt_unv.cc
62
63 libpmt_la_LIBADD =                      \
64         $(BOOST_THREAD_LIB)             \
65         -lstdc++
66
67 noinst_HEADERS = \
68         $(GENERATED_H)                  \
69         pmt_int.h                       \
70         qa_pmt.h                        \
71         qa_pmt_prims.h
72
73 # Build the qa code into its own library
74
75 noinst_LTLIBRARIES += libpmt-qa.la
76
77 libpmt_qa_la_SOURCES =                  \
78         qa_pmt.cc                       \
79         qa_pmt_prims.cc                 \
80         qa_pmt_unv.cc                   
81
82 # magic flags
83 libpmt_qa_la_LDFLAGS = $(NO_UNDEFINED) -avoid version
84
85 libpmt_qa_la_LIBADD =                   \
86         libpmt.la                       \
87         $(CPPUNIT_LIBS)                 \
88         -lstdc++                        
89
90 noinst_PROGRAMS =                       \
91         test_pmt
92
93
94 LIBPMTQA = libpmt-qa.la
95
96 test_pmt_SOURCES = test_pmt.cc
97 test_pmt_LDADD   = $(LIBPMTQA)
98
99 # Do creation and inclusion of other Makefiles last
100
101 # common way for generating sources from templates when using
102 # BUILT_SOURCES, using parallel build protection.
103 gen_sources = $(python_built_sources)
104 gen_sources_deps = $(core_generator)
105 par_gen_command = PYTHONPATH=$(top_srcdir)/gruel/src/lib/pmt srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_unv.py
106 include $(top_srcdir)/Makefile.par.gen
107
108 # Rule to create the build header file using GUILE
109 # Doesn't need parallel protections because there is a single target
110 $(PMT_SERIAL_TAGS_H): $(srcdir)/../../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../../scheme/gnuradio/pmt-serial-tags.scm
111         $(RUN_GUILE) $(srcdir)/../../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../../scheme/gnuradio/pmt-serial-tags.scm $(PMT_SERIAL_TAGS_H)