2013-08-29 14:21:13 +00:00
|
|
|
# CORE
|
|
|
|
# Top-level Makefile for CORE project.
|
|
|
|
#
|
|
|
|
|
|
|
|
if WANT_DOCS
|
2018-07-31 12:57:30 -07:00
|
|
|
DOCS = docs man
|
2013-08-29 14:21:13 +00:00
|
|
|
endif
|
2018-03-13 16:20:50 -07:00
|
|
|
|
2013-08-29 14:21:13 +00:00
|
|
|
if WANT_GUI
|
2018-03-13 16:20:50 -07:00
|
|
|
GUI = gui
|
2013-08-29 14:21:13 +00:00
|
|
|
endif
|
2018-03-13 16:20:50 -07:00
|
|
|
|
2013-08-29 14:21:13 +00:00
|
|
|
if WANT_DAEMON
|
2018-03-13 16:20:50 -07:00
|
|
|
DAEMON = scripts daemon
|
2013-08-29 14:21:13 +00:00
|
|
|
endif
|
2018-03-13 16:20:50 -07:00
|
|
|
|
2018-01-04 12:03:14 -08:00
|
|
|
if WANT_NETNS
|
2018-03-13 16:20:50 -07:00
|
|
|
NETNS = netns ns3
|
2018-01-04 12:03:14 -08:00
|
|
|
endif
|
2013-08-29 14:21:13 +00:00
|
|
|
|
|
|
|
# keep docs last due to dependencies on binaries
|
2018-03-13 16:20:50 -07:00
|
|
|
SUBDIRS = $(GUI) $(DAEMON) $(NETNS) $(DOCS)
|
2013-08-29 14:21:13 +00:00
|
|
|
|
2018-03-13 16:20:50 -07:00
|
|
|
ACLOCAL_AMFLAGS = -I config
|
2013-08-29 14:21:13 +00:00
|
|
|
|
|
|
|
# extra files to include with distribution tarball
|
2018-03-13 16:20:50 -07:00
|
|
|
EXTRA_DIST = bootstrap.sh \
|
|
|
|
LICENSE \
|
|
|
|
README.md \
|
|
|
|
ASSIGNMENT_OF_COPYRIGHT.pdf \
|
2019-06-10 15:37:32 -07:00
|
|
|
CHANGELOG.md \
|
2018-03-13 16:20:50 -07:00
|
|
|
.version \
|
|
|
|
.version.date
|
|
|
|
|
|
|
|
DISTCLEAN_TARGETS = aclocal.m4 config.h.in
|
2013-08-29 14:21:13 +00:00
|
|
|
|
|
|
|
# extra cruft to remove
|
2018-03-13 16:20:50 -07:00
|
|
|
DISTCLEANFILES = aclocal.m4 \
|
|
|
|
config.h.in \
|
|
|
|
configure \
|
|
|
|
Makefile.in \
|
|
|
|
config/compile
|
2013-08-29 14:21:13 +00:00
|
|
|
|
2018-03-13 16:20:50 -07:00
|
|
|
MAINTAINERCLEANFILES = .version \
|
|
|
|
.version.date
|
2016-01-29 11:23:03 -05:00
|
|
|
|
2019-06-07 22:07:13 -07:00
|
|
|
define fpm-rpm =
|
|
|
|
fpm -s dir -t rpm -n core \
|
2018-03-13 16:20:50 -07:00
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
2017-12-21 16:19:12 -08:00
|
|
|
--license "BSD" \
|
2019-06-07 22:07:13 -07:00
|
|
|
--description "Common Open Research Emulator" \
|
2019-03-30 21:19:00 -07:00
|
|
|
--url https://github.com/coreemu/core \
|
2018-03-13 16:20:50 -07:00
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
2019-06-10 11:41:27 -07:00
|
|
|
-p core_$(PYTHON)_VERSION_ARCH.rpm \
|
2018-03-13 16:20:50 -07:00
|
|
|
-v $(PACKAGE_VERSION) \
|
2019-06-07 22:07:13 -07:00
|
|
|
--rpm-init scripts/core-daemon \
|
2019-06-17 19:59:44 -07:00
|
|
|
--config-files "/etc/core" \
|
2019-06-12 12:41:01 -07:00
|
|
|
-d "ethtool" \
|
2017-12-21 16:19:12 -08:00
|
|
|
-d "tcl" \
|
|
|
|
-d "tk" \
|
2018-01-04 14:33:25 -08:00
|
|
|
-d "procps-ng" \
|
|
|
|
-d "bash >= 3.0" \
|
|
|
|
-d "bridge-utils" \
|
|
|
|
-d "ebtables" \
|
|
|
|
-d "iproute" \
|
|
|
|
-d "libev" \
|
|
|
|
-d "net-tools" \
|
2019-10-17 14:52:31 -07:00
|
|
|
-d "python3 >= 3.6" \
|
2019-06-07 22:07:13 -07:00
|
|
|
-C $(DESTDIR)
|
2018-01-04 14:33:25 -08:00
|
|
|
endef
|
|
|
|
|
2019-06-07 22:07:13 -07:00
|
|
|
define fpm-deb =
|
|
|
|
fpm -s dir -t deb -n core \
|
2018-03-13 16:20:50 -07:00
|
|
|
-m "$(PACKAGE_MAINTAINERS)" \
|
2019-06-07 22:07:13 -07:00
|
|
|
--license "BSD" \
|
|
|
|
--description "Common Open Research Emulator" \
|
|
|
|
--url https://github.com/coreemu/core \
|
2018-03-13 16:20:50 -07:00
|
|
|
--vendor "$(PACKAGE_VENDOR)" \
|
2019-06-10 11:41:27 -07:00
|
|
|
-p core_$(PYTHON)_VERSION_ARCH.deb \
|
2019-06-07 22:07:13 -07:00
|
|
|
-v $(PACKAGE_VERSION) \
|
|
|
|
--deb-systemd scripts/core-daemon.service \
|
2019-06-17 19:59:44 -07:00
|
|
|
--deb-no-default-config-files \
|
|
|
|
--config-files "/etc/core" \
|
2019-06-12 12:41:01 -07:00
|
|
|
-d "ethtool" \
|
2019-06-07 22:07:13 -07:00
|
|
|
-d "tcl" \
|
|
|
|
-d "tk" \
|
|
|
|
-d "libtk-img" \
|
2018-01-04 14:33:25 -08:00
|
|
|
-d "procps" \
|
|
|
|
-d "libc6 >= 2.14" \
|
|
|
|
-d "bash >= 3.0" \
|
|
|
|
-d "bridge-utils" \
|
|
|
|
-d "ebtables" \
|
|
|
|
-d "iproute2" \
|
|
|
|
-d "libev4" \
|
2019-10-17 14:52:31 -07:00
|
|
|
-d "python3 >= 3.6" \
|
2019-06-07 22:07:13 -07:00
|
|
|
-C $(DESTDIR)
|
2018-01-04 14:33:25 -08:00
|
|
|
endef
|
|
|
|
|
2017-12-21 16:19:12 -08:00
|
|
|
.PHONY: fpm
|
2018-01-04 10:09:35 -08:00
|
|
|
fpm: clean-local-fpm
|
2019-06-07 22:07:13 -07:00
|
|
|
$(MAKE) install DESTDIR=$(DESTDIR)
|
|
|
|
$(call fpm-deb)
|
|
|
|
$(call fpm-rpm)
|
2017-12-19 09:43:19 -08:00
|
|
|
|
2018-01-04 10:09:35 -08:00
|
|
|
.PHONY: clean-local-fpm
|
|
|
|
clean-local-fpm:
|
|
|
|
-rm -rf *.deb
|
|
|
|
-rm -rf *.rpm
|
|
|
|
|
|
|
|
clean-local: clean-local-fpm
|
|
|
|
|
2016-01-29 11:23:03 -05:00
|
|
|
.version: Makefile
|
2018-03-13 16:20:50 -07:00
|
|
|
echo $(PACKAGE_VERSION) > $@
|
2016-01-26 17:01:23 -05:00
|
|
|
|
2016-01-29 11:23:03 -05:00
|
|
|
.version.date: Makefile
|
2018-03-13 16:20:50 -07: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' \
|
2018-04-11 09:57:02 -07:00
|
|
|
-e 's,[@]pythondir[@],$(pythondir),g' \
|
2018-03-13 16:20:50 -07:00
|
|
|
-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)
|
2018-03-22 18:32:58 -07:00
|
|
|
$(call change-files,scripts/core-daemon)
|
2018-03-13 16:20:50 -07:00
|
|
|
$(call change-files,daemon/core/constants.py)
|
2019-03-25 10:44:47 -07:00
|
|
|
$(call change-files,ns3/setup.py)
|
|
|
|
$(call change-files,netns/setup.py)
|
|
|
|
$(call change-files,daemon/setup.py)
|
2018-03-15 14:31:07 -07:00
|
|
|
|
|
|
|
CORE_DOC_SRC = core-python-$(PACKAGE_VERSION)
|
|
|
|
.PHONY: doc
|
|
|
|
doc: doc-clean
|
|
|
|
$(MAKE) -C daemon/doc html
|
|
|
|
mv daemon/doc/_build/html daemon/doc/$(CORE_DOC_SRC)
|
|
|
|
tar -C daemon/doc -czf $(CORE_DOC_SRC).tgz $(CORE_DOC_SRC)
|
|
|
|
|
|
|
|
.PHONY: doc-clean
|
|
|
|
doc-clean:
|
|
|
|
-rm -rf daemon/doc/_build
|
|
|
|
-rm -rf daemon/doc/$(CORE_DOC_SRC)
|
|
|
|
-rm -f $(CORE_DOC_SRC).tgz
|