-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
82 lines (65 loc) · 1.98 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
###########################################
# Build edif2qmasm, a converter from EDIF #
# netlists to LANL's QMASM representation #
# #
# By Scott Pakin <pakin@lanl.gov> #
###########################################
# Modify the following as needed.
prefix = /usr/local
bindir = $(prefix)/bin
mandir = $(prefix)/share/man/man1
sharedir = $(prefix)/share/edif2qmasm
GO = go
INSTALL = install
SED = sed
RST2MAN = rst2man
all: edif2qmasm stdcell.qmasm edif2qmasm.1
VERSION = 1.1
GEN_SOURCES = \
parse-edif.go \
sexptype_string.go
REG_SOURCES = \
edif.go \
edif2qmasm.go \
qmasm.go \
walk-sexp.go
SOURCES = $(REG_SOURCES) $(GEN_SOURCES)
TARCONTENTS = \
$(SOURCES) \
edif2qmasm.1 \
edif2qmasm.rst \
examples \
Makefile \
parse-edif.peg \
stdcell.qmasm
edif2qmasm: $(SOURCES)
$(GO) build -o edif2qmasm
parse-edif.go: parse-edif.peg $(REG_SOURCES)
$(GO) generate -x
# The rule for parse-edif.go produces sexptype_string.go as a side effect.
sexptype_string.go: parse-edif.go
edif2qmasm.1: edif2qmasm.rst
$(SED) "s/:Date:.*/:Date: $$(date +'%Y-%m-%d')/" edif2qmasm.rst | \
$(RST2MAN) > edif2qmasm.1
clean:
$(RM) edif2qmasm
maintainer-clean:
$(RM) $(GEN_SOURCES) parse-edif.tmp
$(RM) edif2qmasm.1 edif2qmasm-$(VERSION).tar.gz
install: edif2qmasm stdcell.qmasm edif2qmasm.1
$(INSTALL) -m 0755 -d $(DESTDIR)$(bindir)
$(INSTALL) -m 0755 edif2qmasm $(DESTDIR)$(bindir)
$(INSTALL) -m 0755 -d $(DESTDIR)$(sharedir)
$(INSTALL) -m 0644 stdcell.qmasm $(DESTDIR)$(sharedir)
$(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)
$(INSTALL) -m 0644 edif2qmasm.1 $(DESTDIR)$(mandir)
gzip $(DESTDIR)$(mandir)/edif2qmasm.1
dist: edif2qmasm-$(VERSION).tar.gz
edif2qmasm-$(VERSION).tar.gz: $(TARCONTENTS)
$(RM) -r edif2qmasm-$(VERSION)
mkdir edif2qmasm-$(VERSION)
cp -r $(TARCONTENTS) edif2qmasm-$(VERSION)
cd edif2qmasm-$(VERSION)/examples && $(MAKE) clean
tar -czvf edif2qmasm-$(VERSION).tar.gz edif2qmasm-$(VERSION)
$(RM) -r edif2qmasm-$(VERSION)
.PHONY: all clean maintainer-clean install dist