913b2bd81d8612ef311b40caae7f4f4d3a615b42
[debian/gnuradio] / gr-qtgui / src / lib / Makefile.am
1 #
2 # Copyright 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 # Install this stuff so that it ends up as the gnuradio.qtgui module
25 # This usually ends up at:
26 #   ${prefix}/lib/python${python_version}/site-packages/gnuradio/qtgui
27
28 ourpythondir = $(grpythondir)/qtgui
29 ourlibdir    = $(grpyexecdir)/qtgui
30
31 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
32               $(QT_INCLUDES) -I. $(WITH_INCLUDES)
33
34 SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(STD_DEFINES_AND_INCLUDES) \
35         $(WITH_SWIG_INCLUDES) $(WITH_INCLUDES)
36
37 ALL_IFILES =                            \
38         $(LOCAL_IFILES)                 \
39         $(NON_LOCAL_IFILES)             
40
41 NON_LOCAL_IFILES =                      \
42         $(GNURADIO_I)
43
44 LOCAL_IFILES =                          \
45         $(top_srcdir)/gr-qtgui/src/lib/qtgui.i
46
47 # These files are built by SWIG.  The first is the C++ glue.
48 # The second is the python wrapper that loads the shared library
49 # and knows how to call our extensions.
50
51 # Only include these files in the build if qtgui passes configure checks
52 # This is mostly to help make distcheck pass
53 if BUILD_QT
54 QMAKE_SOURCES =                                 \
55         spectrumdisplayform_moc.cc              \
56         FrequencyDisplayPlot_moc.cc             \
57         TimeDomainDisplayPlot_moc.cc            \
58         WaterfallDisplayPlot_moc.cc             \
59         Waterfall3DDisplayPlot_moc.cc           \
60         spectrumdisplayform_ui.h
61 endif
62
63 EXTRA_DIST = spectrumdisplayform.ui
64
65 BUILT_SOURCES =                                 \
66         qtgui.cc                                \
67         qtgui.py                                \
68         $(QMAKE_SOURCES)
69
70 # This gets qtgui.py installed in the right place
71 ourpython_PYTHON =                      \
72         qtgui.py
73
74 # Build the library for Python module to link against
75 ourlib_LTLIBRARIES = _qtgui.la
76
77 # Build the normal library for C++ apps to link against
78 lib_LTLIBRARIES = libqtgui.la
79
80 # These are the source files that go into the shared library
81 libqtgui_la_SOURCES =   \
82         spectrumdisplayform.cc                  \
83         FrequencyDisplayPlot.cc                 \
84         TimeDomainDisplayPlot.cc                \
85         WaterfallDisplayPlot.cc                 \
86         Waterfall3DDisplayPlot.cc               \
87         waterfallGlobalData.cc                  \
88         SpectrumGUIClass.cc                     \
89         spectrumUpdateEvents.cc                 \
90         plot_waterfall.cc                       \
91         $(QMAKE_SOURCES)                        \
92         qtgui_sink_c.cc                         \
93         qtgui_sink_f.cc
94
95 _qtgui_la_SOURCES =                     \
96         $(libqtgui_la_SOURCES)          \
97         qtgui.cc
98
99 # These headers get installed in ${prefix}/include/gnuradio
100 grinclude_HEADERS =                     \
101         spectrumdisplayform.h           \
102         FrequencyDisplayPlot.h          \
103         TimeDomainDisplayPlot.h         \
104         WaterfallDisplayPlot.h          \
105         Waterfall3DDisplayPlot.h        \
106         SpectrumGUIClass.h              \
107         waterfallGlobalData.h           \
108         highResTimeFunctions.h          \
109         plot_waterfall.h                \
110         spectrumUpdateEvents.h          \
111         qtgui.h                         \
112         qtgui_sink_c.h                  \
113         qtgui_sink_f.h
114
115 if BUILD_QT
116 %_moc.cc : %.h
117         $(QT_MOC_EXEC) -DQT_SHARED -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB $< -o $@
118
119 %_ui.h : %.ui
120         $(QT_UIC_EXEC) $< -o $@
121 else
122 %_moc.cc : %.h
123         touch $@
124
125 %_ui.h : %.ui
126         touch $@
127 endif
128
129 # magic flags
130 _qtgui_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
131 libqtgui_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
132
133 # link the library against the c++ standard library
134 _qtgui_la_LIBADD =              \
135         $(PYTHON_LDFLAGS)       \
136         $(GNURADIO_CORE_LA)     \
137         -lstdc++                \
138         $(QT_LIBS)
139
140
141 libqtgui_la_LIBADD =            \
142         $(GNURADIO_CORE_LA)     \
143         -lstdc++                \
144         $(QT_LIBS)
145
146 qtgui.cc qtgui.py: qtgui.i $(ALL_IFILES)
147         $(SWIG) $(SWIGPYTHONARGS) -module qtgui -o qtgui.cc $(LOCAL_IFILES)
148
149 # These swig headers get installed in ${prefix}/include/gnuradio/swig
150 swiginclude_HEADERS =                   \
151         $(LOCAL_IFILES)
152
153
154 MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
155
156 # Don't distribute output of swig
157 dist-hook:
158         @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
159         @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done