# # Makefile-librfn.am # # Part of librfn (a general utility library from redfelineninja.org.uk) # # Copyright (C) 2012, 2013 Daniel Thompson # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # # librfn.a # # librfn is (at this point in time) too informally managed to make system # wide installations wide. Instead the library is recommended for use as # a good source for copy and paste ideas or as a git submodule. This # autotools build system is only really provided to support building the # demos and test suite. For that reasons we currently mark both the # library and the headers as noinst (i.e. no system-wide installation). noinst_LIBRARIES += librfn/librfn.a noinst_HEADERS += \ include/librfn.h \ include/librfn/atomic.h \ include/librfn/benchmark.h \ include/librfn/bitops.h \ include/librfn/console.h \ include/librfn/constexpr.h \ include/librfn/enum.h \ include/librfn/fibre.h \ include/librfn/fixed.h \ include/librfn/list.h \ include/librfn/rand.h \ include/librfn/fuzz.h \ include/librfn/hex.h \ include/librfn/messageq.h \ include/librfn/mlog.h \ include/librfn/pack.h \ include/librfn/protothreads.h \ include/librfn/regdump.h \ include/librfn/rgb.h \ include/librfn/ringbuf.h \ include/librfn/rotenc.h \ include/librfn/stats.h \ include/librfn/string.h \ include/librfn/time.h \ include/librfn/util.h \ include/librfn/wavheader.h LIBRFN_CFLAGS = -I$(top_srcdir)/include LIBRFN_LIBS = $(top_builddir)/librfn/librfn.a librfn_librfn_a_CPPFLAGS = $(LIBRFN_CFLAGS) librfn_librfn_a_SOURCES = \ librfn/benchmark.c \ librfn/bitops.c \ librfn/console.c \ librfn/posix/console_posix.c \ librfn/enum.c \ librfn/fibre.c \ librfn/fuzz.c \ librfn/hex.c \ librfn/list.c \ librfn/messageq.c \ librfn/mlog.c \ librfn/pack.c \ librfn/rand.c \ librfn/regdump.c \ librfn/rgb.c \ librfn/ringbuf.c \ librfn/rotenc.c \ librfn/stats.c \ librfn/string.c \ librfn/wavheader.c \ librfn/util.c if HAVE_CLOCK_GETTIME librfn_librfn_a_SOURCES += \ librfn/posix/fibre_posix.c \ librfn/posix/time_posix.c endif # # librfn demos # noinst_PROGRAMS += src/consoledemo src_consoledemo_SOURCES = src/consoledemo.c src_consoledemo_CFLAGS = $(LIBRFN_CFLAGS) src_consoledemo_LDADD = $(LIBRFN_LIBS) if HAVE_CLOCK_GETTIME noinst_PROGRAMS += src/fibredemo src_fibredemo_SOURCES = src/fibredemo.c src_fibredemo_CFLAGS = $(LIBRFN_CFLAGS) src_fibredemo_LDADD = $(LIBRFN_LIBS) noinst_PROGRAMS += src/benchmark src_benchmark_SOURCES = src/benchmark.c src/libbench.c src/libbench.h src_benchmark_CFLAGS = $(LIBRFN_CFLAGS) src_benchmark_LDADD = $(LIBRFN_LIBS) endif noinst_PROGRAMS += src/regdumpdemo src_regdumpdemo_SOURCES = src/regdumpdemo.c src_regdumpdemo_CFLAGS = $(LIBRFN_CFLAGS) src_regdumpdemo_LDADD = $(LIBRFN_LIBS) noinst_PROGRAMS += src/gammademo src_gammademo_SOURCES = src/gammademo.c src_gammademo_CFLAGS = $(LIBRFN_CFLAGS) src_gammademo_LDADD = $(LIBRFN_LIBS) # # librfn test suite # tests = tests += tests/bitopstest tests_bitopstest_SOURCES = tests/bitopstest.c tests_bitopstest_CFLAGS = $(LIBRFN_CFLAGS) tests_bitopstest_LDADD = $(LIBRFN_LIBS) tests += tests/constexprtest tests_constexprtest_SOURCES = tests/constexprtest.c tests_constexprtest_CFLAGS = $(LIBRFN_CFLAGS) tests_constexprtest_LDADD = $(LIBRFN_LIBS) tests += tests/enumtest tests_enumtest_SOURCES = tests/enumtest.c tests_enumtest_CFLAGS = $(LIBRFN_CFLAGS) tests_enumtest_LDADD = $(LIBRFN_LIBS) tests += tests/fibretest tests_fibretest_SOURCES = tests/fibretest.c tests_fibretest_CFLAGS = $(LIBRFN_CFLAGS) tests_fibretest_LDADD = $(LIBRFN_LIBS) # fibredemotest must use TESTS directly. tests is appended # to both noinst_PROGRAMS and TESTS but fibredemotest is a script that # wraps the demo program and cannot be compiled. TESTS += tests/fibredemotest tests += tests/fuzztest tests_fuzztest_SOURCES = tests/fuzztest.c tests_fuzztest_CFLAGS = $(LIBRFN_CFLAGS) tests_fuzztest_LDADD = $(LIBRFN_LIBS) tests += tests/hextest tests_hextest_SOURCES = tests/hextest.c tests_hextest_CFLAGS = $(LIBRFN_CFLAGS) tests_hextest_LDADD = $(LIBRFN_LIBS) tests += tests/listtest tests_listtest_SOURCES = tests/listtest.c tests_listtest_CFLAGS = $(LIBRFN_CFLAGS) tests_listtest_LDADD = $(LIBRFN_LIBS) tests += tests/messageqtest tests_messageqtest_SOURCES = tests/messageqtest.c tests_messageqtest_CFLAGS = $(LIBRFN_CFLAGS) tests_messageqtest_LDADD = $(LIBRFN_LIBS) tests += tests/mlogtest tests_mlogtest_SOURCES = tests/mlogtest.c tests_mlogtest_CFLAGS = $(LIBRFN_CFLAGS) tests_mlogtest_LDADD = $(LIBRFN_LIBS) tests += tests/protothreadstest tests_protothreadstest_SOURCES = tests/protothreadstest.c tests_protothreadstest_CFLAGS = $(LIBRFN_CFLAGS) tests_protothreadstest_LDADD = $(LIBRFN_LIBS) tests += tests/randtest tests_randtest_SOURCES = tests/randtest.c tests_randtest_CFLAGS = $(LIBRFN_CFLAGS) tests_randtest_LDADD = $(LIBRFN_LIBS) tests += tests/ringbuftest tests_ringbuftest_SOURCES = tests/ringbuftest.c tests_ringbuftest_CFLAGS = $(LIBRFN_CFLAGS) tests_ringbuftest_LDADD = $(LIBRFN_LIBS) tests += tests/rotenctest tests_rotenctest_SOURCES = tests/rotenctest.c tests_rotenctest_CFLAGS = $(LIBRFN_CFLAGS) tests_rotenctest_LDADD = $(LIBRFN_LIBS) tests += tests/statstest tests_statstest_SOURCES = tests/statstest.c tests_statstest_CFLAGS = $(LIBRFN_CFLAGS) tests_statstest_LDADD = $(LIBRFN_LIBS) tests += tests/wavheadertest tests_wavheadertest_SOURCES = tests/wavheadertest.c tests_wavheadertest_CFLAGS = $(LIBRFN_CFLAGS) tests_wavheadertest_LDADD = $(LIBRFN_LIBS) tests += tests/utiltest tests_utiltest_SOURCES = tests/utiltest.c tests_utiltest_CFLAGS = $(LIBRFN_CFLAGS) tests_utiltest_LDADD = $(LIBRFN_LIBS) noinst_PROGRAMS += $(tests) TESTS += $(tests)