2013-08-29 15:21:13 +01:00
|
|
|
# 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
|
2018-01-15 10:20:11 +00:00
|
|
|
DOCS = doc
|
2013-08-29 15:21:13 +01:00
|
|
|
endif
|
|
|
|
if WANT_GUI
|
|
|
|
GUI = gui
|
|
|
|
endif
|
|
|
|
if WANT_DAEMON
|
|
|
|
DAEMON = scripts daemon
|
|
|
|
endif
|
2018-01-04 20:03:14 +00:00
|
|
|
if WANT_NETNS
|
2018-01-05 00:34:22 +00:00
|
|
|
NETNS = netns ns3
|
2018-01-04 20:03:14 +00:00
|
|
|
endif
|
2013-08-29 15:21:13 +01:00
|
|
|
|
|
|
|
# keep docs last due to dependencies on binaries
|
2018-01-04 20:03:14 +00:00
|
|
|
SUBDIRS = ${GUI} ${DAEMON} ${DOCS} ${NETNS}
|
2013-08-29 15:21:13 +01:00
|
|
|
|
|
|
|
ACLOCAL_AMFLAGS = -I config
|
|
|
|
|
|
|
|
# extra files to include with distribution tarball
|
2017-12-18 17:28:41 +00:00
|
|
|
EXTRA_DIST = bootstrap.sh LICENSE \
|
2018-01-11 20:03:55 +00:00
|
|
|
README.md ASSIGNMENT_OF_COPYRIGHT.pdf \
|
2018-03-07 23:47:14 +00:00
|
|
|
Changelog kernel \
|
2015-12-28 19:56:00 +00:00
|
|
|
python-prefix.py revision.sh \
|
2016-01-26 22:01:23 +00:00
|
|
|
.version .version.date \
|
2013-08-29 15:21:13 +01:00
|
|
|
packaging/deb/compat \
|
|
|
|
packaging/deb/copyright \
|
|
|
|
packaging/deb/changelog \
|
|
|
|
packaging/deb/rules \
|
|
|
|
packaging/deb/control \
|
|
|
|
packaging/deb/core-daemon.install.in \
|
2016-01-29 15:42:02 +00:00
|
|
|
packaging/deb/core-daemon.prerm.in \
|
2013-08-29 15:21:13 +01:00
|
|
|
packaging/deb/core-gui.install.in \
|
|
|
|
packaging/rpm/core.spec.in \
|
|
|
|
packaging/rpm/specfiles.sh
|
|
|
|
|
|
|
|
DISTCLEAN_TARGETS = aclocal.m4 config.h.in
|
|
|
|
|
|
|
|
# extra cruft to remove
|
2013-09-10 14:52:09 +01:00
|
|
|
DISTCLEANFILES = aclocal.m4 config.h.in configure Makefile.in config/compile
|
2013-08-29 15:21:13 +01:00
|
|
|
|
2016-01-29 16:23:03 +00:00
|
|
|
MAINTAINERCLEANFILES = \
|
|
|
|
.version \
|
|
|
|
.version.date
|
|
|
|
|
2013-08-29 15:21:13 +01:00
|
|
|
# don't include svn dirs in source tarball
|
|
|
|
dist-hook:
|
|
|
|
rm -rf `find $(distdir)/kernel -name .svn`
|
|
|
|
|
2017-08-19 00:35:26 +01:00
|
|
|
# build a source RPM
|
2013-08-29 15:21:13 +01:00
|
|
|
.PHONY: rpm
|
2015-02-13 22:35:38 +00:00
|
|
|
rpm: dist
|
2017-08-19 00:35:26 +01:00
|
|
|
mkdir -p $(HOME)/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
|
|
|
echo '%_topdir $(HOME)/rpmbuild' > ~/.rpmmacros
|
2015-02-13 22:35:38 +00:00
|
|
|
cp -afv core-@CORE_VERSION@.tar.gz ~/rpmbuild/SOURCES
|
2013-08-29 15:21:13 +01:00
|
|
|
cp -afv packaging/rpm/core.spec ~/rpmbuild/SPECS
|
|
|
|
rpmbuild -bs ~/rpmbuild/SPECS/core.spec
|
|
|
|
|
|
|
|
# build a Ubuntu deb package using CDBS
|
|
|
|
.PHONY: deb
|
|
|
|
deb:
|
|
|
|
rm -rf debian
|
|
|
|
mkdir -p debian
|
|
|
|
cp -vf packaging/deb/* debian/
|
2015-05-22 01:56:10 +01:00
|
|
|
@echo "First create source archive with: dpkg-source -b core-@CORE_VERSION@"
|
2013-08-29 15:21:13 +01:00
|
|
|
@echo "Then build with: pbuilder-dist precise i386 build core*.dsc"
|
|
|
|
|
2017-12-22 00:19:12 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-01-04 22:33:25 +00:00
|
|
|
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
|
|
|
|
|
2017-12-22 00:19:12 +00:00
|
|
|
.PHONY: fpm
|
2018-01-04 18:09:35 +00:00
|
|
|
fpm: clean-local-fpm
|
2018-01-11 19:21:56 +00:00
|
|
|
$(MAKE) -C gui install DESTDIR=$(DESTDIR)
|
2017-12-22 00:19:12 +00:00
|
|
|
$(call fpm-gui,rpm,-d "tkimg")
|
|
|
|
$(call fpm-gui,deb,-d "libtk-img")
|
2018-01-05 00:34:22 +00:00
|
|
|
$(call fpm-python,rpm,ns3/setup.py)
|
|
|
|
$(call fpm-python,deb,ns3/setup.py)
|
2018-01-04 22:33:25 +00:00
|
|
|
$(call fpm-daemon-rpm,systemd)
|
|
|
|
$(call fpm-daemon-rpm,sysv)
|
|
|
|
$(call fpm-daemon-deb,systemd)
|
|
|
|
$(call fpm-daemon-deb,sysv)
|
2017-12-19 17:43:19 +00:00
|
|
|
|
2018-01-04 18:09:35 +00:00
|
|
|
.PHONY: clean-local-fpm
|
|
|
|
clean-local-fpm:
|
|
|
|
-rm -rf *.deb
|
|
|
|
-rm -rf *.rpm
|
|
|
|
|
2013-08-29 15:21:13 +01:00
|
|
|
.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
|
2016-01-26 22:01:23 +00:00
|
|
|
|
2018-01-04 18:09:35 +00:00
|
|
|
clean-local: clean-local-fpm
|
|
|
|
|
2016-01-29 16:23:03 +00:00
|
|
|
.version: Makefile
|
2016-01-26 22:01:23 +00:00
|
|
|
echo $(CORE_VERSION) > $@
|
|
|
|
|
2016-01-29 16:23:03 +00:00
|
|
|
.version.date: Makefile
|
2016-01-26 22:01:23 +00:00
|
|
|
echo $(CORE_VERSION_DATE) > $@
|