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-03-13 23:20:50 +00:00
|
|
|
DOCS = doc
|
2013-08-29 15:21:13 +01:00
|
|
|
endif
|
2018-03-13 23:20:50 +00:00
|
|
|
|
2013-08-29 15:21:13 +01:00
|
|
|
if WANT_GUI
|
2018-03-13 23:20:50 +00:00
|
|
|
GUI = gui
|
2013-08-29 15:21:13 +01:00
|
|
|
endif
|
2018-03-13 23:20:50 +00:00
|
|
|
|
2013-08-29 15:21:13 +01:00
|
|
|
if WANT_DAEMON
|
2018-03-13 23:20:50 +00:00
|
|
|
DAEMON = scripts daemon
|
2013-08-29 15:21:13 +01:00
|
|
|
endif
|
2018-03-13 23:20:50 +00:00
|
|
|
|
2018-01-04 20:03:14 +00:00
|
|
|
if WANT_NETNS
|
2018-03-13 23:20:50 +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-03-13 23:20:50 +00:00
|
|
|
SUBDIRS = $(GUI) $(DAEMON) $(NETNS) $(DOCS)
|
2013-08-29 15:21:13 +01:00
|
|
|
|
2018-03-13 23:20:50 +00:00
|
|
|
ACLOCAL_AMFLAGS = -I config
|
2013-08-29 15:21:13 +01:00
|
|
|
|
|
|
|
# extra files to include with distribution tarball
|
2018-03-13 23:20:50 +00:00
|
|
|
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
|
2013-08-29 15:21:13 +01:00
|
|
|
|
|
|
|
# extra cruft to remove
|
2018-03-13 23:20:50 +00:00
|
|
|
DISTCLEANFILES = aclocal.m4 \
|
|
|
|
config.h.in \
|
|
|
|
configure \
|
|
|
|
Makefile.in \
|
|
|
|
config/compile
|
2013-08-29 15:21:13 +01:00
|
|
|
|
2018-03-13 23:20:50 +00:00
|
|
|
MAINTAINERCLEANFILES = .version \
|
|
|
|
.version.date
|
2016-01-29 16:23:03 +00:00
|
|
|
|
2017-12-22 00:19:12 +00:00
|
|
|
define fpm-python =
|
|
|
|
fpm -s python -t $1 \
|
2018-03-13 23:20:50 +00:00
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
2017-12-22 00:19:12 +00:00
|
|
|
$2
|
|
|
|
endef
|
|
|
|
|
|
|
|
define fpm-gui =
|
|
|
|
fpm -s dir -t $1 -n core-gui \
|
2018-03-13 23:20:50 +00:00
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
2017-12-22 00:19:12 +00:00
|
|
|
--license "BSD" \
|
|
|
|
--description "Common Open Research Emulator GUI front-end" \
|
|
|
|
--url http://www.nrl.navy.mil/itd/ncs/products/core \
|
2018-03-13 23:20:50 +00:00
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
2017-12-22 00:19:12 +00:00
|
|
|
-p core-gui_VERSION_ARCH.$1 \
|
2018-03-13 23:20:50 +00:00
|
|
|
-v $(PACKAGE_VERSION) \
|
2017-12-22 00:19:12 +00:00
|
|
|
-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 \
|
2018-03-13 23:20:50 +00:00
|
|
|
-p NAME_sysv_VERSION_ARCH.rpm \
|
|
|
|
--rpm-init scripts/core-daemon \
|
|
|
|
--python-install-bin $(bindir) \
|
|
|
|
--python-install-data $(prefix) \
|
|
|
|
--python-install-lib $(pythondir) \
|
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
2018-01-04 22:33:25 +00:00
|
|
|
-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 \
|
2018-03-13 23:20:50 +00:00
|
|
|
--python-install-bin $(bindir) \
|
|
|
|
--python-install-data $(prefix) \
|
|
|
|
--python-install-lib $(pythondir) \
|
|
|
|
$2 $3 \
|
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
2018-01-04 22:33:25 +00:00
|
|
|
-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-03-13 23:20:50 +00:00
|
|
|
$(call fpm-daemon-rpm)
|
|
|
|
$(call fpm-daemon-deb,sysv,--deb-init,scripts/core-daemon)
|
|
|
|
$(call fpm-daemon-deb,systemd,--deb-systemd,scripts/core-daemon.service)
|
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
|
|
|
|
|
|
|
|
clean-local: clean-local-fpm
|
|
|
|
|
2016-01-29 16:23:03 +00:00
|
|
|
.version: Makefile
|
2018-03-13 23:20:50 +00:00
|
|
|
echo $(PACKAGE_VERSION) > $@
|
2016-01-26 22:01:23 +00:00
|
|
|
|
2016-01-29 16:23:03 +00:00
|
|
|
.version.date: Makefile
|
2018-03-13 23:20:50 +00:00
|
|
|
echo $(PACKAGE_DATE) > $@
|
|
|
|
|
|
|
|
define change-files =
|
|
|
|
$(info creating file $1 from $1.in)
|
|
|
|
@$(SED) -e 's,[@]sbindir[@],$(sbindir),g' \
|
|
|
|
-e 's,[@]bindir[@],$(bindir),g' \
|
|
|
|
-e 's,[@]PYTHON[@],$(PYTHON),g' \
|
|
|
|
-e 's,[@]PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
|
|
|
|
-e 's,[@]PACKAGE_DATE[@],$(PACKAGE_DATE),g' \
|
|
|
|
-e 's,[@]CORE_LIB_DIR[@],$(CORE_LIB_DIR),g' \
|
|
|
|
-e 's,[@]CORE_STATE_DIR[@],$(CORE_STATE_DIR),g' \
|
|
|
|
-e 's,[@]CORE_DATA_DIR[@],$(CORE_DATA_DIR),g' \
|
|
|
|
-e 's,[@]CORE_CONF_DIR[@],$(CORE_CONF_DIR),g' \
|
|
|
|
-e 's,[@]CORE_GUI_CONF_DIR[@],$(CORE_GUI_CONF_DIR),g' \
|
|
|
|
-e 's,[@]brctl_path[@],$(brctl_path),g' \
|
|
|
|
-e 's,[@]sysctl_path[@],$(sysctl_path),g' \
|
|
|
|
-e 's,[@]ip_path[@],$(ip_path),g' \
|
|
|
|
-e 's,[@]tc_path[@],$(tc_path),g' \
|
|
|
|
-e 's,[@]ebtables_path[@],$(ebtables_path),g' \
|
|
|
|
-e 's,[@]mount_path[@],$(mount_path),g' \
|
|
|
|
-e 's,[@]umount_path[@],$(umount_path),g' \
|
|
|
|
-e 's,[@]ovs_vs_path[@],$(ovs_vs_path),g' \
|
|
|
|
-e 's,[@]ovs_of_path[@],$(ovs_of_path),g' \
|
|
|
|
< $1.in > $1
|
|
|
|
endef
|
|
|
|
|
|
|
|
all: change-files
|
|
|
|
|
|
|
|
.PHONY: change-files
|
|
|
|
change-files:
|
|
|
|
$(call change-files,gui/core-gui)
|
|
|
|
$(call change-files,scripts/core-daemon.service)
|
|
|
|
$(call change-files,daemon/core/constants.py)
|