-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
42 lines (34 loc) · 1.25 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.PHONY: all
all: derive
PACKAGEDB=package.conf.d
ifneq (,$(findstring CYGWIN, $(ARCH)))
PREFIX_PATH:=$(shell cygpath.exe -m -w $(PWD))/dist
PACKAGEDB_PATH:=$(shell cygpath.exe -m -w $(abspath $(PACKAGEDB)))
else
PREFIX_PATH=$(PWD)/dist
PACKAGEDB_PATH=$(abspath $(PACKAGEDB))
endif
.PHONY: packagedb
packagedb: $(PACKAGEDB)
$(PACKAGEDB):
ghc-pkg init $(PACKAGEDB)
install-local:
cd netlist && cabal install --prefix=$(PREFIX_PATH) --package-db=$(PACKAGEDB_PATH)
cd netlist-to-vhdl && cabal install --prefix=$(PREFIX_PATH) --package-db=$(PACKAGEDB_PATH)
cd verilog && cabal install --prefix=$(PREFIX_PATH) --package-db=$(PACKAGEDB_PATH)
cd netlist-to-verilog && cabal install --prefix=$(PREFIX_PATH) --package-db=$(PACKAGEDB_PATH)
.PHONY: derive
# run derive on every file that has derived instances in it.
# generated boilerplate code for instances of Binary.
.PHONY: derive
derive:
@for f in `grep -l OPTIONS_DERIVE -r --include=*.hs .`; do \
echo derive $$f; derive $$f; \
sed -i -e 's/[ \t]*$$//g' $$f; done
.PHONY: delete-trailing-whitespace
delete-trailing-whitespace:
@for f in `/usr/bin/find . -iname \*.hs`; do \
sed -i -e 's/[ \t]*$$//g' $$f; done
hudson:
cd netlist && cabal install
cd netlist-to-vhdl && cabal install