Merged features/mp-sched -r8915:9335 into the trunk. The trunk now
[debian/gnuradio] / pmt / src / lib / Makefile.am
1 #
2 # Copyright 2006,2008 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) $(OMNITHREAD_INCLUDES) $(BOOST_CPPFLAGS) \
25         $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
26
27 TESTS = test_pmt
28
29 lib_LTLIBRARIES = libpmt.la libpmt-qa.la
30
31 # ----------------------------------------------------------------
32 # these scripts generate code
33
34 CODE_GENERATOR =                        \
35         generate_unv.py                 \
36         unv_template.h.t                \
37         unv_template.cc.t               \
38         unv_qa_template.cc.t            
39
40 GENERATED_H =                           \
41         pmt_unv_int.h                   \
42         qa_pmt_unv.h                    
43
44 GENERATED_CC =                          \
45         pmt_unv.cc                      \
46         qa_pmt_unv.cc                   
47
48
49
50 # Ensure parallel make does the right thing.
51 # http://sources.redhat.com/automake/automake.html#Multiple-Outputs
52
53 STAMPS = generate-stamp
54
55 generate-stamp: $(CODE_GENERATOR)
56         @rm -f generate-tmp
57         @touch generate-tmp
58         PYTHONPATH=$(top_srcdir)/pmt/src/lib srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_unv.py
59         @mv -f generate-tmp $@
60
61 $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): generate-stamp
62 ## Recover from the removal of $@
63         @if test -f $@; then :; else \
64                trap 'rm -rf generate-lock generate-stamp' 1 2 13 15; \
65                if mkdir generate-lock 2>/dev/null; then \
66 ## This code is being executed by the first process.
67                  rm -f generate-stamp; \
68                  $(MAKE) $(AM_MAKEFLAGS) generate-stamp; \
69                  rmdir generate-lock; \
70                else \
71 ## This code is being executed by the follower processes.
72 ## Wait until the first process is done.
73                  while test -d generate-lock; do sleep 1; done; \
74 ## Succeed if and only if the first process succeeded.
75                  test -f generate-stamp; exit $$?; \
76                fi; \
77              fi
78
79
80 pmt_serial_tags.h: $(srcdir)/../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../scheme/gnuradio/pmt-serial-tags.scm
81         $(RUN_GUILE) $(srcdir)/../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../scheme/gnuradio/pmt-serial-tags.scm pmt_serial_tags.h
82
83 BUILT_SOURCES = $(GENERATED_H) $(GENERATED_CC) pmt_serial_tags.h
84
85 # ----------------------------------------------------------------
86
87 EXTRA_DIST =                            \
88         $(CODE_GENERATOR)               \
89         $(STAMPS)
90
91
92 # These are the source files that go into the pmt shared library
93 libpmt_la_SOURCES =                     \
94         pmt.cc                          \
95         pmt_io.cc                       \
96         pmt_pool.cc                     \
97         pmt_serialize.cc                \
98         pmt_unv.cc                      
99
100 # magic flags
101 libpmt_la_LDFLAGS = $(NO_UNDEFINED)
102
103 # link the library against the c++ standard library
104 libpmt_la_LIBADD =                      \
105         $(OMNITHREAD_LA)                \
106         -lstdc++                        
107
108 include_HEADERS =                       \
109         pmt.h                           \
110         pmt_pool.h                      \
111         pmt_serial_tags.h               
112
113 noinst_HEADERS =                        \
114         $(GENERATED_H)                  \
115         pmt_int.h                       \
116         qa_pmt.h                        \
117         qa_pmt_prims.h                  
118
119
120 # Build the qa code into its own library
121
122 libpmt_qa_la_SOURCES =                  \
123         qa_pmt.cc                       \
124         qa_pmt_prims.cc                 \
125         qa_pmt_unv.cc                   
126
127 # magic flags
128 libpmt_qa_la_LDFLAGS = $(NO_UNDEFINED) -avoid version
129
130 libpmt_qa_la_LIBADD =                   \
131         libpmt.la                       \
132         $(CPPUNIT_LIBS)                 \
133         -lstdc++                        
134
135
136 noinst_PROGRAMS =                       \
137         test_pmt
138
139
140 LIBPMT   = libpmt.la
141 LIBPMTQA = libpmt-qa.la $(LIBPMT)
142
143 test_pmt_SOURCES = test_pmt.cc
144 test_pmt_LDADD   = $(LIBPMTQA)
145
146
147 CLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc