Last active
October 25, 2017 15:17
-
-
Save TuxCoding/df9562edea66560ed6c9426c6a2f461a to your computer and use it in GitHub Desktop.
Simple Makefile for build bluespec projects. It will compile and link it by default. You could run `make compile link sim` to test it at the same moment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TOPFILE = Testbench.bsv | |
| TOPMODULE = mkTestbench | |
| BUILD_PATH = build | |
| BSIM_EXE = $(BUILD_PATH)/outputFile | |
| BSCFLAGS = -u | |
| BUILD_DIR_FLAGS = -simdir $(BUILD_PATH) -bdir $(BUILD_PATH) -info-dir $(BUILD_PATH) | |
| default: compile link | |
| build: | |
| mkdir -p $(BUILD_PATH) | |
| .PHONY: compile | |
| compile: build | |
| @echo Compiling for Bluesim ... | |
| bsc $(BUILD_DIR_FLAGS) -sim -g $(TOPMODULE) $(BSCFLAGS) $(TOPFILE) | |
| @echo Compilation finished | |
| .PHONY: link | |
| link: | |
| @echo Linking Bluesim... | |
| bsc $(BUILD_DIR_FLAGS) -e $(TOPMODULE) -sim -o ./$(BSIM_EXE) | |
| @echo Bluesim linking finished | |
| .PHONY: simulate | |
| sim: | |
| @echo Simulating... | |
| ./$(BSIM_EXE) | |
| @echo Bluesim simulation finished | |
| .PHONY: clean | |
| clean: | |
| rm -rf build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment