From 87c58ab4a0753d8dccb8ebb9210a0c1fde7da7b1 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Thu, 8 Oct 2015 12:14:36 -0700 Subject: Install Stanza as a dependency of anything that uses it This way I don't have to type "make install-linux" whenever a new Stanza zip drops. --- .gitignore | 1 + Makefile | 37 ++++++++++++++++++++++--------------- README.md | 4 ---- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 7effd6b8..e7c22f3a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ src/lib/stanza src/*/__MACOSX src/main/stanza/firrtl-main utils/bin/firrtl +utils/bin/stanza spec/spec.aux spec/spec.log spec/spec.toc diff --git a/Makefile b/Makefile index 881f2745..ad098689 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,37 @@ -# Installs stanza into /usr/local/bin -# TODO Talk to Patrick to fill this in - root_dir ?= $(PWD) test_dir ?= $(root_dir)/test regress_dir ?= $(root_dir)/regress firrtl_dir ?= $(root_dir)/src/main/stanza +install_dir ?= $(root_dir)/utils/bin + +stanza ?= $(install_dir)/stanza all-noise: ${MAKE} all || ${MAKE} fail all: done -install-linux: - cd src/lib && unzip stanza-linux.zip - cd src/lib/stanza && sudo ./stanza -platform linux -install /usr/local/bin/stanza +# Installs Stanza into $(insall_dir) +stanza_zip_name = $(subst Darwin,mac,$(subst Linux,linux,$(shell uname))) +stanza_target_name = $(subst Darwin,os-x,$(subst Linux,linux,$(shell uname))) + +$(root_dir)/src/lib/stanza/stamp: src/lib/stanza-$(stanza_zip_name).zip + rm -rf src/lib/stanza + mkdir -p src/lib + cd src/lib && unzip stanza-$(stanza_zip_name).zip + touch $@ -install-mac: - cd src/lib && unzip stanza-mac.zip - cd src/lib/stanza && sudo ./stanza -platform os-x -install /usr/local/bin/stanza +$(stanza): $(root_dir)/src/lib/stanza/stamp + cd src/lib/stanza && ./stanza -platform $(stanza_target_name) -install $(stanza) -build-deploy: - cd $(firrtl_dir) && stanza -i firrtl-main.stanza -o $(root_dir)/utils/bin/firrtl +build-deploy: $(stanza) + cd $(firrtl_dir) && $(stanza) -i firrtl-main.stanza -o $(root_dir)/utils/bin/firrtl -build: - cd $(firrtl_dir) && stanza -i firrtl-test-main.stanza -o $(root_dir)/utils/bin/firrtl +build: $(stanza) + cd $(firrtl_dir) && $(stanza) -i firrtl-test-main.stanza -o $(root_dir)/utils/bin/firrtl -build-fast: - cd $(firrtl_dir) && stanza -i firrtl-test-main.stanza -o $(root_dir)/utils/bin/firrtl -flags OPTIMIZE +build-fast: $(stanza) + cd $(firrtl_dir) && $(stanza) -i firrtl-test-main.stanza -o $(root_dir)/utils/bin/firrtl -flags OPTIMIZE check: cd $(test_dir) && lit -v . --path=$(root_dir)/utils/bin/ @@ -49,6 +54,8 @@ custom: clean: rm -f $(test_dir)/*/*/*.out rm -f $(test_dir)/*/*.out + rm -rf src/lib/stanza + rm -f $(stanza) riscv: cd $(test_dir)/riscv-mini && lit -v . --path=$(root_dir)/utils/bin/ diff --git a/README.md b/README.md index dc37b048..b60c7c9f 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ ##### For Linux: 1. Clone the repository: `git clone https://github.com/ucb-bar/firrtl` - 1. Install Stanza: - `make install-linux` 1. Install lit (you need to have pip installed first): `pip install lit` 1. Build firrtl: @@ -36,8 +34,6 @@ ##### For Mac: 1. Clone the repository: `git clone https://github.com/ucb-bar/firrtl` - 1. Install Stanza: - `make install-mac` 1. Install lit (you need to have pip installed first): `pip install lit` 1. Build firrtl: -- cgit v1.2.3