Instead of using recursive Makefile.am, declare all the headers on the top-level Makefile.am, which will take care of all of them.
Signed-off-by: Diego Elio Pettenò flameeyes@flameeyes.eu --- Makefile.am | 21 ++++++++++++++++++++- configure.ac | 5 ----- include/Makefile.am | 1 - include/osmocom/Makefile.am | 1 - include/osmocom/gmr1/Makefile.am | 3 --- include/osmocom/gmr1/l1/Makefile.am | 3 --- include/osmocom/gmr1/sdr/Makefile.am | 1 - 7 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 include/Makefile.am delete mode 100644 include/osmocom/Makefile.am delete mode 100644 include/osmocom/gmr1/Makefile.am delete mode 100644 include/osmocom/gmr1/l1/Makefile.am delete mode 100644 include/osmocom/gmr1/sdr/Makefile.am
diff --git a/Makefile.am b/Makefile.am index c866969..5167991 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,26 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 ACLOCAL_AMFLAGS = -I m4
INCLUDES = $(all_includes) -I$(top_srcdir)/include -SUBDIRS = include src +SUBDIRS = src + +noinst_HEADERS = include/osmocom/gmr1/gsmtap.h \ + include/osmocom/gmr1/l1/a5.h \ + include/osmocom/gmr1/l1/bcch.h \ + include/osmocom/gmr1/l1/ccch.h \ + include/osmocom/gmr1/l1/conv.h \ + include/osmocom/gmr1/l1/crc.h \ + include/osmocom/gmr1/l1/defs.h \ + include/osmocom/gmr1/l1/facch3.h \ + include/osmocom/gmr1/l1/interleave.h \ + include/osmocom/gmr1/l1/punct.h \ + include/osmocom/gmr1/l1/rach.h \ + include/osmocom/gmr1/l1/scramb.h \ + include/osmocom/gmr1/l1/tch3.h \ + include/osmocom/gmr1/sdr/defs.h \ + include/osmocom/gmr1/sdr/dkab.h \ + include/osmocom/gmr1/sdr/fcch.h \ + include/osmocom/gmr1/sdr/nb.h \ + include/osmocom/gmr1/sdr/pi4cxpsk.h
BUILT_SOURCES = $(top_srcdir)/.version $(top_srcdir)/.version: diff --git a/configure.ac b/configure.ac index 60c850b..a4f3952 100644 --- a/configure.ac +++ b/configure.ac @@ -42,11 +42,6 @@ dnl Generate the output AM_CONFIG_HEADER(config.h)
AC_OUTPUT( - include/Makefile - include/osmocom/Makefile - include/osmocom/gmr1/Makefile - include/osmocom/gmr1/l1/Makefile - include/osmocom/gmr1/sdr/Makefile src/Makefile src/l1/Makefile src/sdr/Makefile diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index 3578a80..0000000 --- a/include/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = osmocom diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am deleted file mode 100644 index 950eae8..0000000 --- a/include/osmocom/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = gmr1 diff --git a/include/osmocom/gmr1/Makefile.am b/include/osmocom/gmr1/Makefile.am deleted file mode 100644 index 91c5c44..0000000 --- a/include/osmocom/gmr1/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = l1 sdr - -noinst_HEADERS = gsmtap.h diff --git a/include/osmocom/gmr1/l1/Makefile.am b/include/osmocom/gmr1/l1/Makefile.am deleted file mode 100644 index 40f2bd2..0000000 --- a/include/osmocom/gmr1/l1/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -noinst_HEADERS = \ - conv.h crc.h interleave.h punct.h scramb.h \ - a5.h bcch.h ccch.h rach.h facch3.h tch3.h diff --git a/include/osmocom/gmr1/sdr/Makefile.am b/include/osmocom/gmr1/sdr/Makefile.am deleted file mode 100644 index 03c9769..0000000 --- a/include/osmocom/gmr1/sdr/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -noinst_HEADERS = defs.h dkab.h fcch.h nb.h pi4cxpsk.h
Only the l1 subdirectory's sources are shared between the two binaries, so build those into a static archive and link it in both. The sdr sources are compiled in directly.
Signed-off-by: Diego Elio Pettenò flameeyes@flameeyes.eu --- configure.ac | 2 -- src/Makefile.am | 17 +++++++++-------- src/l1/Makefile.am | 9 --------- src/sdr/Makefile.am | 7 ------- 4 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 src/l1/Makefile.am delete mode 100644 src/sdr/Makefile.am
diff --git a/configure.ac b/configure.ac index a4f3952..87cfc79 100644 --- a/configure.ac +++ b/configure.ac @@ -43,8 +43,6 @@ AM_CONFIG_HEADER(config.h)
AC_OUTPUT( src/Makefile - src/l1/Makefile - src/sdr/Makefile Makefile Doxyfile ) diff --git a/src/Makefile.am b/src/Makefile.am index c3991ae..a1f8c9b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,15 +1,16 @@ -SUBDIRS = l1 sdr - INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMODSP_CFLAGS) -AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMODSP_LIBS)
+noinst_LIBRARIES = libl1.a bin_PROGRAMS = gmr1_rx gmr1_gen_mat
-gmr1_rx_SOURCES = gmr1_rx.c gsmtap.c -gmr1_rx_LDADD = $(top_builddir)/src/l1/libgmr1-l1.a \ - $(top_builddir)/src/sdr/libgmr1-sdr.a \ - $(FFTW3F_LIBS) +libl1_a_SOURCES = l1/conv.c l1/crc.c l1/interleave.c l1/punct.c \ + l1/scramb.c l1/a5.c l1/bcch.c l1/ccch.c l1/rach.c \ + l1/facch3.c l1/tch3.c + +gmr1_rx_SOURCES = gmr1_rx.c gsmtap.c sdr/dkab.c sdr/fcch.c sdr/nb.c \ + sdr/pi4cxpsk.c +gmr1_rx_LDADD = libl1.a $(LIBOSMOCORE_LIBS) $(LIBOSMODSP_LIBS) $(FFTW3F_LIBS)
gmr1_gen_mat_SOURCES = gmr1_gen_mat.c -gmr1_gen_mat_LDADD = $(top_builddir)/src/l1/libgmr1-l1.a +gmr1_gen_mat_LDADD = libl1.a $(LIBOSMOCORE_LIBS) diff --git a/src/l1/Makefile.am b/src/l1/Makefile.am deleted file mode 100644 index 3ef01a3..0000000 --- a/src/l1/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) -AM_LDFLAGS = $(LIBOSMOCORE_LIBS) - -noinst_LIBRARIES = libgmr1-l1.a - -libgmr1_l1_a_SOURCES = \ - conv.c crc.c interleave.c punct.c scramb.c \ - a5.c bcch.c ccch.c rach.c facch3.c tch3.c diff --git a/src/sdr/Makefile.am b/src/sdr/Makefile.am deleted file mode 100644 index df1d2d3..0000000 --- a/src/sdr/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMODSP_CFLAGS) $(FFTW3F_CFLAGS) -AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMODSP_LIBS) $(FFTW3F_LIBS) - -noinst_LIBRARIES = libgmr1-sdr.a - -libgmr1_sdr_a_SOURCES = dkab.c fcch.c nb.c pi4cxpsk.c
This removes two warnings but it might better test the result instead of just ignoring it.
Signed-off-by: Diego Elio Pettenò flameeyes@flameeyes.eu --- src/gmr1_rx.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gmr1_rx.c b/src/gmr1_rx.c index d48acad..dd028c7 100644 --- a/src/gmr1_rx.c +++ b/src/gmr1_rx.c @@ -311,7 +311,7 @@ _rx_tch3_facch(struct chan_desc *cd, struct osmo_cxvec *burst) { struct tch3_state *st = &cd->tch_state; sbit_t ebits[104]; - int rv, bi, sync_id; + int bi, sync_id; float toa;
/* Burst index */ @@ -321,7 +321,7 @@ _rx_tch3_facch(struct chan_desc *cd, struct osmo_cxvec *burst) fprintf(stderr, "[.] FACCH3 (bi=%d)\n", bi);
/* Demodulate burst */ - rv = gmr1_pi4cxpsk_demod( + gmr1_pi4cxpsk_demod( &gmr1_nt3_facch_burst, burst, cd->sps, -cd->freq_err, ebits, &sync_id, &toa, NULL @@ -352,14 +352,14 @@ _rx_tch3_speech(struct chan_desc *cd, struct osmo_cxvec *burst) sbit_t ebits[212]; ubit_t sbits[4], ciph[208]; uint8_t frame0[10], frame1[10]; - int rv, conv[2]; + int conv[2]; float toa;
/* Debug */ fprintf(stderr, "[.] TCH3\n");
/* Demodulate burst */ - rv = gmr1_pi4cxpsk_demod( + gmr1_pi4cxpsk_demod( &gmr1_nt3_speech_burst, burst, cd->sps, -cd->freq_err, ebits, NULL, &toa, NULL
This simplifies the Makefile and uses the overridable htmldir setting instead.
Signed-off-by: Diego Elio Pettenò flameeyes@flameeyes.eu --- Makefile.am | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 5167991..f5f703d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,12 +33,9 @@ EXTRA_DIST = git-version-gen
if HAVE_DOXYGEN
-pkgdocdir=$(docdir)/$(PACKAGE)-$(VERSION) -doc_htmldir=$(pkgdocdir)/html +html_DATA = $(top_builddir)/doc/html.tar
-doc_html_DATA = $(top_builddir)/doc/html.tar - -$(doc_html_DATA): $(top_builddir)/doc/html/index.html +$(html_DATA): $(top_builddir)/doc/html/index.html cd $(top_builddir)/doc && tar cf html.tar html
$(top_builddir)/doc/html/index.html: $(SOURCES) Doxyfile @@ -47,10 +44,10 @@ $(top_builddir)/doc/html/index.html: $(SOURCES) Doxyfile $(DOXYGEN) Doxyfile
install-data-hook: - cd $(DESTDIR)$(doc_htmldir) && tar xf html.tar --strip-components 1 && rm -f html.tar + cd $(DESTDIR)$(htmldir) && tar xf html.tar --strip-components 1 && rm -f html.tar
uninstall-hook: - cd $(DESTDIR) && rm -rf $(doc_htmldir) + rm -rf $(DESTDIR)$(htmldir)
DX_CLEAN = doc/{html,latex}/* doc/html.tar
The project is not building any library and is not relying on the .la files from other libraries, so there is no reason to use libtool in this context.
Since libtool is gone, there is no reason to keep m4 around anymore.
Signed-off-by: Diego Elio Pettenò flameeyes@flameeyes.eu --- Makefile.am | 1 - configure.ac | 8 +------- m4/.gitignore | 2 -- 3 files changed, 1 insertions(+), 10 deletions(-) delete mode 100644 m4/.gitignore
diff --git a/Makefile.am b/Makefile.am index f5f703d..152ca98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,4 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 -ACLOCAL_AMFLAGS = -I m4
INCLUDES = $(all_includes) -I$(top_srcdir)/include SUBDIRS = src diff --git a/configure.ac b/configure.ac index 87cfc79..61d7a24 100644 --- a/configure.ac +++ b/configure.ac @@ -11,22 +11,16 @@ dnl checks for programs AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_INSTALL -LT_INIT -AC_PROG_LIBTOOL +AC_PROG_RANLIB
AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
-AC_CONFIG_MACRO_DIR([m4]) - dnl checks for libraries PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.4.1) PKG_CHECK_MODULES(LIBOSMODSP, libosmodsp) PKG_CHECK_MODULES(FFTW3F, fftw3f >= 3.2.0)
-dnl checks for header files -AC_HEADER_STDC - # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " diff --git a/m4/.gitignore b/m4/.gitignore deleted file mode 100644 index 64d9bbc..0000000 --- a/m4/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/libtool.m4 -/lt*.m4
Signed-off-by: Diego Elio Pettenò flameeyes@flameeyes.eu --- Makefile.am | 2 -- configure.ac | 2 +- 2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 152ca98..1127e5b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,3 @@ -AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 - INCLUDES = $(all_includes) -I$(top_srcdir)/include SUBDIRS = src
diff --git a/configure.ac b/configure.ac index 61d7a24..5c25351 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_INIT([osmo-gmr], m4_esyscmd([./git-version-gen .tarball-version]), [gmr@lists.osmocom.org])
-AM_INIT_AUTOMAKE([dist-bzip2]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.6])
dnl kernel style compile messages m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Signed-off-by: Diego Elio Pettenò flameeyes@flameeyes.eu --- .gitignore | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore index b34624d..3047cf1 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ Doxyfile
doc/ src/gmr1_rx +src/gmr1_gen_mat
Hi,
Just fyi I'll look at those (for osmo-gmr and libosmo-dsp) in detail over the weekend.
I'll have to see exactly what they do because the state of the repo might not reflect what I have in mind for the future. (for eg I see the gmr1 code become a library with the installed headers, or even if l1 is the only one used in both binary in the public repo, I still have some test / future binary that depend on both sdr/ and l1/ ... things like that).
In general I'm not a big fan of the flattening ... I kinda like that each repo is responsible for defining it's own source files. Beside build speed (which for me is not really an argument given it's so small), what are the advantages ?
Cheers,
Sylvain
Hi Sylvain,
On Thu, Jul 05, 2012 at 01:18:37AM +0200, Sylvain Munaut wrote:
In general I'm not a big fan of the flattening ... I kinda like that each repo is responsible for defining it's own source files. Beside build speed (which for me is not really an argument given it's so small), what are the advantages ?
I personally like the 'flattening' idea to some extent, especially since you don't have to add another 'Makefile' line to configure.ac and do a full autoreconf/configure/make cycle every time you add one file to the repository. I haven't tried it, but I suppose now it is sufficient to simply add the file to Makefile.am, and a simple "make" will notice it, regenerate Makefile and build.
So I'm not sure if the benefit of having Makefile.[am,in] for each subdirectory (especially the empty ones like 'include' which just state a single SUBDIR line) really is the better approach.
But of course, for your code / repositories you maintain, it is your decision, I just wanted to share some thoughts.
Regards, Harald