diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2022-02-18 08:45:06 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2022-02-18 08:45:06 +0100 |
| commit | 8f4a9aa1330cf7af7ad6db3ee4681c76925c258d (patch) | |
| tree | ed2864d0c1ff7c6894c15ec20720e482fbd25fbb /lab4/VGA_MOTOR/build/util.mk | |
| parent | e2cb9471bea69f76bc3a17b117f4a8d634355fc3 (diff) | |
| download | tsea83-8f4a9aa1330cf7af7ad6db3ee4681c76925c258d.tar.gz | |
lab4 initial
Diffstat (limited to 'lab4/VGA_MOTOR/build/util.mk')
| -rw-r--r-- | lab4/VGA_MOTOR/build/util.mk | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/lab4/VGA_MOTOR/build/util.mk b/lab4/VGA_MOTOR/build/util.mk new file mode 100644 index 0000000..3bc84ca --- /dev/null +++ b/lab4/VGA_MOTOR/build/util.mk @@ -0,0 +1,59 @@ +# Make sure we can include this from more than one place without any +# issues: +ifneq ($(UTILISINCLUDED),1) + + +# The default shell for make is /bin/sh which doesn't work for some of +# the commands used in these files. +SHELL=/bin/bash + + +# Make sure we are running at low priority... +NICE = nice -n 19 + +# Reverses the order of all arguments given to the function. +reverse_order = $(if $(1), $(word $(words $(1)),$(1)) $(call reverse_order,$(wordlist 2,$(words $(1)),dummy $(1))),$(1)) + +# Fix the path by inserting ../../.. if the path is relative. If absolute, do nothing +fixpath3 = $(shell echo "$(1)" | sed 's,^\([^/]\),../../../\1,') + +# Fix the path by inserting ../.. if the path is relative. If absolute, do nothing +fixpath2 = $(shell echo "$(1)" | sed 's,^\([^/]\),../../\1,') + + +# Fix the path by inserting ../ if the path is relative. If absolute, do nothing +fixpath1 = $(shell echo "$(1)" | sed 's,^\([^/]\),../\1,') + +export S +export INCDIRS +export T +export U +export PART +export PROJNAME + + +sanitycheckclock: + $(foreach i,$(S), bash sanitycheck.sh "$(i)" &&) true + +sanitychecksynth: sanitycheckclock + @if [ "$(S)" == "" ]; then echo 'ERROR: No synthesizable files specified!';false;fi + +sanitychecktb: sanitycheckclock + @if [ "$(T)" == "" ]; then echo 'ERROR: No testbench files specified!';false;fi + @if [ "$(S)" == "" ]; then echo 'WARNING: No synthesizable files specified!';fi + + + +%.clean: + rm -rf "$*-synthdir" "$*-simdir" + + + +clean: + rm -rf *synthdir *simdir *~ + + + +UTILISINCLUDED=1 +endif + |
