automake: add basic framwork
* Added needed boilerplate to configure.ac * Wrap original Makefile's with automake: - Renamed all original Makefile -> Makefile.legacy - Force automake generated Makefile to call Makefile.legacy: Currently handle: all, install, clean, distclean, dist, docs, config - Note: our temporary 'dist' target conflicts with automake 'dist' target. * Temporarily added extra dist files into build_tools/make_dist (until we move "make dist" functionality into automake) * For now, we don't try to compile ppp/ as it wasn't compiled from the top-level Makefile before. Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
This commit is contained in:
parent
723b3ce87f
commit
fc620819b6
4
.gitignore
vendored
4
.gitignore
vendored
@ -4,6 +4,9 @@
|
||||
.*.lo.d
|
||||
*.asciidoc
|
||||
*.html
|
||||
Makefile
|
||||
Makefile.in
|
||||
auxdir/
|
||||
build_tools/menuselect-deps
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
@ -36,6 +39,7 @@ patgen
|
||||
patlooptest
|
||||
pattest
|
||||
sethdlc
|
||||
stamp-h1
|
||||
timertest
|
||||
tonezone.lo
|
||||
tonezones.txt
|
||||
|
27
Makefile.am
Normal file
27
Makefile.am
Normal file
@ -0,0 +1,27 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
LEGACY_MAKE = \
|
||||
$(MAKE) -f $(srcdir)/Makefile.legacy \
|
||||
top_srcdir=$(top_srcdir) \
|
||||
srcdir=$(srcdir)
|
||||
|
||||
SUBDIRS = xpp
|
||||
|
||||
all-local:
|
||||
$(LEGACY_MAKE) all
|
||||
|
||||
clean-local:
|
||||
$(LEGACY_MAKE) clean
|
||||
|
||||
install-exec-hook:
|
||||
$(LEGACY_MAKE) install
|
||||
|
||||
dist:
|
||||
$(LEGACY_MAKE) dist
|
||||
|
||||
docs config:
|
||||
$(LEGACY_MAKE) $@
|
||||
|
||||
DISTCLEANFILES = makeopts config.log config.status .*.d
|
||||
|
||||
.PHONY: docs config
|
@ -14,9 +14,6 @@ ifeq ($(strip $(foreach var,clean distclean dist-clean,$(findstring $(var),$(MAK
|
||||
endif
|
||||
endif
|
||||
|
||||
SUBDIRS_UTILS_ALL:= ppp
|
||||
SUBDIRS_UTILS := xpp
|
||||
|
||||
OPTFLAGS=-O2
|
||||
CFLAGS+=-I. $(OPTFLAGS) -g -fPIC -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
|
||||
ifneq (,$(findstring ppc,$(UNAME_M)))
|
||||
@ -134,14 +131,9 @@ all: prereq programs
|
||||
|
||||
libs: $(LTZ_SO) $(LTZ_A)
|
||||
|
||||
utils-subdirs:
|
||||
@for dir in $(SUBDIRS_UTILS); do \
|
||||
$(MAKE) -C $$dir; \
|
||||
done
|
||||
|
||||
programs: libs utils
|
||||
|
||||
utils: $(BINS) utils-subdirs
|
||||
utils: $(BINS)
|
||||
|
||||
tests: $(TEST_BINS)
|
||||
|
||||
@ -224,7 +216,7 @@ install: all install-programs
|
||||
|
||||
install-programs: install-utils install-libs
|
||||
|
||||
install-utils: utils install-utils-subdirs
|
||||
install-utils: utils
|
||||
ifneq (,$(BINS))
|
||||
install -d $(DESTDIR)$(BIN_DIR)
|
||||
install $(BINS) $(DESTDIR)$(BIN_DIR)/
|
||||
@ -273,11 +265,6 @@ endif
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)/$(INC_DIR)
|
||||
$(INSTALL) -m 644 tonezone.h $(DESTDIR)$(INC_DIR)/
|
||||
|
||||
install-utils-subdirs:
|
||||
@for dir in $(SUBDIRS_UTILS); do \
|
||||
$(MAKE) -C $$dir install; \
|
||||
done
|
||||
|
||||
install-tests: tests
|
||||
ifneq (,$(TEST_BINS))
|
||||
install -d $(DESTDIR)$(BIN_DIR)
|
||||
@ -332,12 +319,6 @@ clean:
|
||||
rm -f $(BINS) $(TEST_BINS)
|
||||
rm -f *.o dahdi_cfg tzdriver sethdlc
|
||||
rm -f $(LTZ_SO) $(LTZ_A) *.lo
|
||||
@for dir in $(SUBDIRS_UTILS_ALL); do \
|
||||
$(MAKE) -C $$dir clean; \
|
||||
done
|
||||
@for dir in $(SUBDIRS_UTILS); do \
|
||||
$(MAKE) -C $$dir clean; \
|
||||
done
|
||||
rm -f libtonezone*
|
||||
rm -f fxotune
|
||||
rm -f core
|
||||
@ -360,7 +341,7 @@ config.status: configure
|
||||
@echo "****"
|
||||
@exit 1
|
||||
|
||||
.PHONY: distclean dist-clean clean all install programs tests devel data config install-programs install-libs install-utils-subdirs utils-subdirs prereq dist
|
||||
.PHONY: distclean dist-clean clean all install programs tests devel data config install-programs install-libs prereq dist
|
||||
|
||||
FORCE:
|
||||
|
@ -24,7 +24,16 @@ echo "$version" > "$tmp_version_dir/.version"
|
||||
extra_dist='
|
||||
autoconfig.h.in
|
||||
configure
|
||||
ppp/Makefile
|
||||
Makefile
|
||||
xpp/Makefile
|
||||
ppp/Makefile.in
|
||||
Makefile.in
|
||||
xpp/Makefile.in
|
||||
auxdir/install-sh
|
||||
auxdir/missing
|
||||
'
|
||||
|
||||
find $extra_dist | cpio -pudmv "$tmp_version_dir"
|
||||
tar czf "$output" -C "$tmp_work_dir" "$tarball_prefix"
|
||||
rm -rf "$tmp_work_dir"
|
||||
|
19
configure.ac
19
configure.ac
@ -10,6 +10,17 @@ AC_INIT([dahdi-tools], short_version, [www.asterisk.org])
|
||||
|
||||
# check existence of the package
|
||||
AC_CONFIG_SRCDIR([dahdi_cfg.c])
|
||||
AC_CONFIG_AUX_DIR([auxdir])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
build_version=`build_tools/make_version . dahdi/tools`
|
||||
AC_SUBST([BUILD_VERSION], "$build_version")
|
||||
|
||||
# enable nice build output on automake1.11
|
||||
m4_pattern_allow([AM_DEFAULT_VERBOSITY])
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],[AM_DEFAULT_VERBOSITY=1])
|
||||
AM_CONDITIONAL([SILENT_RULES], [test "$AM_DEFAULT_VERBOSITY" = '0'])
|
||||
|
||||
AC_COPYRIGHT("dahdi-tools")
|
||||
AC_REVISION($Revision$)
|
||||
@ -37,10 +48,15 @@ AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h])
|
||||
AC_CHECK_TOOL([LD], [ld])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_AWK
|
||||
AST_CHECK_GNU_MAKE
|
||||
|
||||
test_obj=conftest.o
|
||||
@ -216,6 +232,9 @@ AC_SUBST([TOOLSVERSION], m4_esyscmd([build_tools/make_version . dahdi/tools]))
|
||||
AC_CONFIG_FILES([
|
||||
makeopts
|
||||
version.c
|
||||
Makefile
|
||||
ppp/Makefile
|
||||
xpp/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
|
14
ppp/Makefile.am
Normal file
14
ppp/Makefile.am
Normal file
@ -0,0 +1,14 @@
|
||||
LEGACY_MAKE = \
|
||||
$(MAKE) -f $(srcdir)/Makefile.legacy \
|
||||
top_srcdir=$(top_srcdir) \
|
||||
srcdir=$(srcdir)
|
||||
|
||||
all-local:
|
||||
$(LEGACY_MAKE) all
|
||||
|
||||
clean-local:
|
||||
$(LEGACY_MAKE) clean
|
||||
|
||||
# Cannot allow this yet
|
||||
distclean:
|
||||
maintainer-clean:
|
18
xpp/Makefile.am
Normal file
18
xpp/Makefile.am
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
LEGACY_MAKE = \
|
||||
$(MAKE) -f $(srcdir)/Makefile.legacy \
|
||||
top_srcdir=$(top_srcdir) \
|
||||
srcdir=$(srcdir)
|
||||
|
||||
all-local:
|
||||
$(LEGACY_MAKE) all
|
||||
|
||||
clean-local:
|
||||
$(LEGACY_MAKE) clean
|
||||
|
||||
install-exec-hook:
|
||||
$(LEGACY_MAKE) install
|
||||
|
||||
# Cannot allow this yet
|
||||
distclean:
|
||||
maintainer-clean:
|
Loading…
Reference in New Issue
Block a user