diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-07-26 00:05:14 +0200 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-07-26 00:05:14 +0200 |
commit | 173622e9e82b7c2b1c6f8146056661b2a6577735 (patch) | |
tree | 4d14127163d9621e7462a8fc25444552b5a80137 /Makefile | |
download | sysc-playground-173622e9e82b7c2b1c6f8146056661b2a6577735.tar.gz sysc-playground-173622e9e82b7c2b1c6f8146056661b2a6577735.zip |
add some initial playground examples + scripts to build
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f22fbd0 --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +export CC = clang +export CXX = clang++ + +export SYSTEMC_HOME := $(PWD)/INSTALL + +SRCS = $(wildcard *.cc) +BINS = $(SRCS:%.cc=BUILD/UTIL/%) + +# -- SYSTEMC UTILS ------------------------------------------------------------- + +run: build + @for B in $(BINS); do \ + echo "==> $$B"; \ + $$B; \ + done + +build: INSTALL/lib/libsystemc.a BUILD/UTIL $(SRCS) + ninja -C BUILD/UTIL + +BUILD/UTIL: CMakeLists.txt + cmake -B $@ -S . \ + -G Ninja \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ + -DCMAKE_BUILD_TYPE=DEBUG \ + #-DCMAKE_FIND_DEBUG_MODE=ON + #ninja -C $@ -t compdb > compile_commands.json + +# -- SYSTEMC ------------------------------------------------------------------- + +INSTALL/lib/libsystemc.a: BUILD/SYSC + ninja -C BUILD/SYSC install + +BUILD/SYSC: systemc + cmake -B $@ -S systemc \ + -G Ninja \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ + -DCMAKE_BUILD_TYPE=DEBUG \ + -DCMAKE_INSTALL_PREFIX=$(PWD)/INSTALL \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CXX_STANDARD=14 + +systemc: + git clone --depth=1 https://github.com/accellera-official/systemc.git + +# -- UTIL ---------------------------------------------------------------------- + +fmt: + clang-format -i *.cc *.h + +# -- CLEAN --------------------------------------------------------------------- + +clean: + $(RM) -r BUILD/UTIL compile_commands.json + +distclean: clean + $(RM) -r BUILD INSTALL systemc |