aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-11-04 01:58:40 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-11-04 01:58:40 +0100
commitdcea35a1bfc12d5ff35929971cba5a48638deb85 (patch)
tree04dbc75e16cf82e99ac379ca91b9662606bf6aaf /Makefile
parentcedf79f0264f3cdbe61a293e345bbd368e1e6c65 (diff)
downloadsysc-playground-dcea35a1bfc12d5ff35929971cba5a48638deb85.tar.gz
sysc-playground-dcea35a1bfc12d5ff35929971cba5a48638deb85.zip
cmake: integrate systemc build into cmake build (offer source/external integration, mainly for own cmake experiments)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile54
1 files changed, 22 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index 360a8b9..795540f 100644
--- a/Makefile
+++ b/Makefile
@@ -10,12 +10,12 @@ ifeq ($V,1)
endif
SRCS = $(shell find src test -type f -name \*.h -or -name \*.cc)
-BINS = $(SRCS:src/%.cc=BUILD/PLAYGROUND/%)
+BINS = $(SRCS:src/%.cc=BUILD/pg-%)
# -- SYSTEMC PLAYGROUND --------------------------------------------------------
-build: $(SYSTEMC_HOME)/lib/libsystemc.a BUILD/PLAYGROUND/CMakeCache.txt $(SRCS)
- ninja -C BUILD/PLAYGROUND $(NINJA_FLAGS)
+build: config
+ ninja -C BUILD $(NINJA_FLAGS)
run: build
@for B in $(BINS); do \
@@ -23,48 +23,38 @@ run: build
$$B; \
done
-run/%: $(SYSTEMC_HOME)/lib/libsystemc.a BUILD/PLAYGROUND/CMakeCache.txt src/%.cc
- ninja -C BUILD/PLAYGROUND $(NINJA_FLAGS) $*
- BUILD/PLAYGROUND/$*
+run/%: config
+ ninja -C BUILD $(NINJA_FLAGS) pg-$*
+ BUILD/pg-$*
test: build
- cd BUILD/PLAYGROUND/test && ctest --output-on-failure $(CCTEST_FLAGS)
+ cd BUILD/test && ctest --output-on-failure $(CCTEST_FLAGS)
-BUILD/PLAYGROUND/CMakeCache.txt: CMakeLists.txt
- cmake -B BUILD/PLAYGROUND $@ -S . \
+config: BUILD/CMakeCache.txt cmake/CMakeLists-sysc-external.txt cmake/CMakeLists-sysc-fetch.txt
+BUILD/CMakeCache.txt: CMakeLists.txt
+ # SystemC options:
+ # BUILD_SHARED_LIBS
+ cmake -B BUILD -S . \
-G Ninja \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCMAKE_BUILD_TYPE=DEBUG \
- #-DCMAKE_FIND_DEBUG_MODE=ON
- ln -sfn BUILD/PLAYGROUND/compile_commands.json
- #ninja -C $@ -t compdb > compile_commands.json
-
-# -- SYSTEMC -------------------------------------------------------------------
-
-$(SYSTEMC_HOME)/lib/libsystemc.a: BUILD/SYSC/CMakeCache.txt
- ninja -C BUILD/SYSC install $(NINJA_FLAGS)
-
-BUILD/SYSC/CMakeCache.txt: systemc
- cmake -B BUILD/SYSC -S systemc \
- -G Ninja \
- -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
- -DCMAKE_BUILD_TYPE=DEBUG \
- -DCMAKE_INSTALL_PREFIX=$(SYSTEMC_HOME) \
+ -DCMAKE_CXX_STANDARD=14 \
-DBUILD_SHARED_LIBS=OFF \
- -DCMAKE_CXX_STANDARD=14
-
-systemc:
- git clone --depth=1 https://github.com/accellera-official/systemc.git
+ #-DCMAKE_FIND_DEBUG_MODE=ON
+ ln -sfn BUILD/compile_commands.json
# -- UTIL ----------------------------------------------------------------------
+targets:
+ ninja -C BUILD -t targets
+
fmt:
- clang-format -i $(shell find src test -type f -name \*.h -or -name \*.cc)
+ clang-format -i $(SRCS)
# -- CLEAN ---------------------------------------------------------------------
clean:
- $(RM) -r BUILD/PLAYGROUND compile_commands.json
+ ninja -C BUILD clean
-distclean: clean
- $(RM) -r BUILD $(SYSTEMC_HOME) systemc
+distclean:
+ $(RM) -r BUILD compile_commands.json