core-extra/Makefile.am
2018-03-08 14:43:27 -08:00

132 lines
2.8 KiB
Makefile

# CORE
# (c)2010-2012 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
# Top-level Makefile for CORE project.
#
if WANT_DOCS
DOCS = doc
endif
if WANT_GUI
GUI = gui
endif
if WANT_DAEMON
DAEMON = scripts daemon
endif
if WANT_NETNS
NETNS = netns ns3
endif
# keep docs last due to dependencies on binaries
SUBDIRS = ${GUI} ${DAEMON} ${DOCS} ${NETNS}
ACLOCAL_AMFLAGS = -I config
# extra files to include with distribution tarball
EXTRA_DIST = bootstrap.sh LICENSE \
README.md ASSIGNMENT_OF_COPYRIGHT.pdf \
Changelog \
python-prefix.py revision.sh \
.version .version.date
DISTCLEAN_TARGETS = aclocal.m4 config.h.in
# extra cruft to remove
DISTCLEANFILES = aclocal.m4 config.h.in configure Makefile.in config/compile
MAINTAINERCLEANFILES = \
.version \
.version.date
define fpm-python =
fpm -s python -t $1 \
-m "$(CORE_MAINTAINERS)" \
--vendor "$(CORE_VENDOR)" \
$2
endef
define fpm-gui =
fpm -s dir -t $1 -n core-gui \
-m "$(CORE_MAINTAINERS)" \
--license "BSD" \
--description "Common Open Research Emulator GUI front-end" \
--url http://www.nrl.navy.mil/itd/ncs/products/core \
--vendor "$(CORE_VENDOR)" \
-p core-gui_VERSION_ARCH.$1 \
-v $(CORE_VERSION) \
-d "bash" \
-d "tcl" \
-d "tk" \
$2 \
-C $(DESTDIR)
endef
define fpm-daemon-rpm =
fpm -s python -t rpm \
-p NAME_$1_VERSION_ARCH.rpm \
--python-setup-py-arguments --service=$1 \
-m "$(CORE_MAINTAINERS)" \
--vendor "$(CORE_VENDOR)" \
-d "procps-ng" \
-d "bash >= 3.0" \
-d "bridge-utils" \
-d "ebtables" \
-d "iproute" \
-d "libev" \
-d "net-tools" \
-d "python >= 2.7, python < 3.0" \
netns/setup.py daemon/setup.py
endef
define fpm-daemon-deb =
fpm -s python -t deb \
-p NAME_$1_VERSION_ARCH.deb \
--python-setup-py-arguments --service=$1 \
-m "$(CORE_MAINTAINERS)" \
--vendor "$(CORE_VENDOR)" \
-d "procps" \
-d "libc6 >= 2.14" \
-d "bash >= 3.0" \
-d "bridge-utils" \
-d "ebtables" \
-d "iproute2" \
-d "libev4" \
-d "python (>= 2.7), python (<< 3.0)" \
--deb-recommends quagga \
netns/setup.py daemon/setup.py
endef
.PHONY: fpm
fpm: clean-local-fpm
$(MAKE) -C gui install DESTDIR=$(DESTDIR)
$(call fpm-gui,rpm,-d "tkimg")
$(call fpm-gui,deb,-d "libtk-img")
$(call fpm-python,rpm,ns3/setup.py)
$(call fpm-python,deb,ns3/setup.py)
$(call fpm-daemon-rpm,systemd)
$(call fpm-daemon-rpm,sysv)
$(call fpm-daemon-deb,systemd)
$(call fpm-daemon-deb,sysv)
.PHONY: clean-local-fpm
clean-local-fpm:
-rm -rf *.deb
-rm -rf *.rpm
.PHONY: core-restart
core-restart:
/etc/init.d/core-daemon stop
daemon/sbin/core-cleanup
rm -f /var/log/core-daemon.log
/etc/init.d/core-daemon start
clean-local: clean-local-fpm
.version: Makefile
echo $(CORE_VERSION) > $@
.version.date: Makefile
echo $(CORE_VERSION_DATE) > $@