Commit 2758151d authored by Marvin Meiers's avatar Marvin Meiers Committed by Antoine Kaufmann
Browse files

sims/external: add clean target for external simulators

Add new target `clean-external` to the Makefile, which triggers the
clean task of the respective buid system for each external simulator.
Each simulator can also be cleaned individually by using the targets
`{simulator name}-clean` (e.g. `gem5-clean`).
parent 38178f85
......@@ -55,6 +55,10 @@ all: $(ALL_ALL)
clean:
rm -rf $(CLEAN_ALL)
clean-external: $(EXTERNAL_CLEAN_TASKS_ALL)
clean-all: clean clean-external
distclean:
rm -rf $(CLEAN_ALL) $(DISTCLEAN_ALL)
......@@ -99,6 +103,8 @@ help:
@echo "Targets:"
@echo " all: builds all the tools directly in this repo"
@echo " clean: cleans all the tool folders in this repo"
@echo " clean-external: cleans all external simulators"
@echo " clean-all: executes both clean and clean-external"
@echo " build-images: prepare prereqs for VMs (images directory)"
@echo " build-images-min: prepare minimal prereqs for VMs"
@echo " documentation: build documentation in doc/build_"
......@@ -108,8 +114,8 @@ help:
@echo " lint-all: run slow & thorough format and style checks"
@echo " clang-format: reformat source (use with caution)"
.PHONY: all clean distclean lint lint-all lint-cpplint lint-clang-tidy \
lint-clang-format clang-format help
.PHONY: all clean clean-external clean-all distclean lint lint-all \
lint-cpplint lint-clang-tidy lint-clang-format clang-format help
include mk/subdir_post.mk
-include $(DEPS_ALL)
......@@ -27,6 +27,7 @@ CLEAN := $(CLEAN) $(DEPS)
CLEAN_ALL := $(CLEAN_ALL) $(CLEAN)
DISTCLEAN_ALL := $(DISTCLEAN_ALL) $(DISTCLEAN)
EXTERNAL_CLEAN_TASKS_ALL := $(EXTERNAL_CLEAN_TASKS_ALL) $(EXTERNAL_CLEAN_TASKS)
DEPS_ALL := $(DEPS_ALL) $(DEPS)
ALL_ALL := $(ALL_ALL) $(ALL)
......@@ -36,5 +37,6 @@ sp := $(basename $(sp))
ALL :=
CLEAN :=
DISTCLEAN :=
EXTERNAL_CLEAN_TASKS :=
DEPS :=
OBJS :=
......@@ -29,5 +29,6 @@ d := $(cur_dir)
ALL :=
CLEAN :=
DISTCLEAN :=
EXTERNAL_CLEAN_TASKS :=
DEPS :=
OBJS :=
......@@ -26,10 +26,12 @@ QEMU_IMG := $(d)qemu/build/qemu-img
QEMU := $(d)qemu/build/qemu-system-x86_64
GEM5_VARIANT ?= fast
EXTERNAL_SIMS_DIR := $(d)
$(eval $(call subdir,simics))
external: $(d)gem5/ready $(d)qemu/ready $(d)ns-3/ready $(d)femu/ready
.PHONY: external
.PHONY: external gem5-clean qemu-clean ns-3-clean femu-clean
$(d)gem5:
git clone https://github.com/simbricks/gem5.git $@
......@@ -41,6 +43,10 @@ $(d)gem5/ready: $(d)gem5
-j`nproc`
touch $@
gem5-clean:
-cd $(EXTERNAL_SIMS_DIR)gem5 && scons --clean build/X86/gem5.$(GEM5_VARIANT)
rm -f $(EXTERNAL_SIMS_DIR)gem5/ready
$(d)qemu:
git clone https://github.com/simbricks/qemu.git $@
......@@ -63,6 +69,10 @@ $(QEMUG_IMG): $(d)qemu/ready
$(QEMU): $(d)qemu/ready
touch $@
qemu-clean:
-+cd $(EXTERNAL_SIMS_DIR)qemu && $(MAKE) clean
rm -f $(EXTERNAL_SIMS_DIR)qemu/ready
$(d)ns-3:
git clone https://github.com/simbricks/ns-3.git $@
......@@ -71,6 +81,10 @@ $(d)ns-3/ready: $(d)ns-3 $(lib_netif)
+cd $< && COSIM_PATH=$(abspath $(base_dir)) ./cosim-build.sh configure
touch $@
ns-3-clean:
-cd $(EXTERNAL_SIMS_DIR)ns-3 && ./waf clean
rm -f $(EXTERNAL_SIMS_DIR)ns-3/ready
$(d)femu:
git clone https://github.com/simbricks/femu.git $@
......@@ -81,5 +95,10 @@ $(d)femu/ready: $(d)femu $(lib_nicif)
EXTRA_CPPFLAGS=-I$(abspath $(lib_dir))
touch $@
femu-clean:
-+cd $(EXTERNAL_SIMS_DIR)femu && $(MAKE) clean
rm -f $(EXTERNAL_SIMS_DIR)femu/ready
DISTCLEAN := $(d)gem5 $(d)qemu $(d)ns-3 $(d)femu
EXTERNAL_CLEAN_TASKS := gem5-clean qemu-clean ns-3-clean femu-clean
include mk/subdir_post.mk
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment