forked from veripool/verilog-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
166 lines (139 loc) · 4.91 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# DESCRIPTION: Run verilog-mode tests, as part of "make test"
#
# Copyright 2008-2013 by Michael McNamara and Wilson Snyder. This package
# is free software; you can redistribute it and/or modify it under the
# terms of either the GNU Lesser General Public License or the Perl
# Artistic License.
#
######################################################################
# Common targets:
# make # Compile source for GNU and Xemacs
# make test # Run self tests
# # See x/verilog-mode.el for version to install
######################################################################
# the directory where the .elc files will be installed
XEMACS ?= xemacs
XEMACS_DEST = /usr/local/lib/xemacs/xemacs-packages/lisp/prog-modes/
EMACS ?= emacs
EMACS_DEST = /usr/share/emacs/site-lisp/
ELC = -batch -q -f batch-byte-compile
MAKECHANGELOG = perl makechangelog
export XEMACS
export EMACS
default : e/verilog-mode.elc x/verilog-mode.elc
release : .timestamps
install : .timestamps
@echo "Installation not supported by this makefile"
false
.timestamps:
@mkdir -p $@
test: .timestamps/test
.timestamps/test: x/verilog-mode.elc e/verilog-mode.elc verilog.info 0test.el .timestamps
ifeq ($(VERILOG_MODE_TEST_FILE),)
$(MAKE) test_batch test_errors test_emacs test_xemacs
@touch $@
@echo ======= ALL TESTS PASSED
else
$(MAKE) test_emacs test_xemacs
endif
#Usage: $(call test-emacs_sub,label,threading)
define test_emacs_sub
test_emacs:: $(1)
$(1): e/verilog-mode.elc
@echo
@echo == $(1)
@mkdir -p e/t
VERILOG_MODE_THREAD=$(2) time $(EMACS) --batch -q --no-site-file -l e/verilog-mode.elc -l 0test.el
endef
$(eval $(call test_emacs_sub,test_emacs_1,1of5))
ifeq ($(VERILOG_MODE_TEST_FILE),)
$(eval $(call test_emacs_sub,test_emacs_2,2of5))
$(eval $(call test_emacs_sub,test_emacs_3,3of5))
$(eval $(call test_emacs_sub,test_emacs_4,4of5))
$(eval $(call test_emacs_sub,test_emacs_5,5of5))
endif
#Usage: $(call test_xemacs_sub,label,threading)
define test_xemacs_sub
test_xemacs:: $(1)
$(1): x/verilog-mode.elc
@echo
@echo == $(1)
@mkdir -p x/t
VERILOG_MODE_THREAD=$(2) time $(XEMACS) --batch -vanilla -l x/verilog-mode.elc -l 0test.el
endef
$(eval $(call test_xemacs_sub,test_xemacs_1,1of5))
ifeq ($(VERILOG_MODE_TEST_FILE),)
$(eval $(call test_xemacs_sub,test_xemacs_2,2of5))
$(eval $(call test_xemacs_sub,test_xemacs_3,3of5))
$(eval $(call test_xemacs_sub,test_xemacs_4,4of5))
$(eval $(call test_xemacs_sub,test_xemacs_5,5of5))
endif
test_errors:
@echo
@echo == test_errors
-# The multiline errors must be in one read()s output or the comint may not match it
-cat error_msgs.out
test_batch: e/verilog-mode.elc
@echo == test_batch
mkdir -p e/b
time ./batch_test.pl
local: .timestamps/local
.timestamps/local: verilog-mode.el
cp verilog-mode.el $(XEMACS_DEST)verilog-mode.el
rm -f $(XEMACS_DEST)verilog-mode.elc
$(XEMACS) $(ELC) $(XEMACS_DEST)verilog-mode.el
cp verilog-mode.el $(EMACS_DEST)verilog-mode.el
rm -f $(EMACS_DEST)verilog-mode.elc
$(EMACS) $(ELC) $(EMACS_DEST)verilog-mode.el
@touch $@
ChangeLog.txt emacs-version.h : make_log.pl verilog-mode.el
ifneq ($(VERILOGMODE_SKIP_MAKELOG),1)
./make_log.pl
endif
ChangeLog : verilog-mode.el makechangelog
$(MAKECHANGELOG) --git verilog-mode.el > $@
x/verilog-mode.el : verilog-mode.el ./config_rev.pl
rm -rf x
mkdir x
./config_rev.pl . . <verilog-mode.el >x/verilog-mode.el
e/verilog-mode.el : verilog-mode.el ./config_rev.pl
-rm -rf e
-mkdir e
./config_rev.pl . . <verilog-mode.el >e/verilog-mode.el
e/verilog-mode.el.gz : e/verilog-mode.el
gzip --best $< --stdout > $@
x/verilog-mode.elc : x/verilog-mode.el
$(XEMACS) $(ELC) x/verilog-mode.el
e/verilog-mode.elc : e/verilog-mode.el
$(EMACS) $(ELC) e/verilog-mode.el
verilog.info : verilog.texinfo
makeinfo verilog.texinfo > verilog.info
######################################################################
# GNU GIT version
gnutrunk:
@echo "gnutrunk needs to be a symlink to a emacs/trunk git checkout"
false
.PHONY: gnu-update gnu-update-trunk
gnu-update: gnu-update-trunk
gnu-update-trunk: gnutrunk
echo "NOT DOING: cd gnutrunk && git pull"
.PHONY: gnu-diff-trunk gnu-diff
gnu-diff: gnu-diff-trunk
gnu-diff-trunk: gnu-update-trunk verilog-mode-tognu.el
diff -u gnutrunk/lisp/progmodes/verilog-mode.el verilog-mode-tognu.el
verilog-mode.patch: gnu-update verilog-mode-tognu.el
diff -u gnutrunk/lisp/progmodes/verilog-mode.el verilog-mode-tognu.el > $@
# Before install, clean to make sure we get proper git ID
gnu-cp:
$(MAKE) clean
$(MAKE) verilog-mode-tognu.el
cp verilog-mode-tognu.el gnutrunk/lisp/progmodes/verilog-mode.el
verilog-mode-tognu.el: e/verilog-mode.el Makefile
cat e/verilog-mode.el \
| sed 's/verilog-mode-version "\(.*\)"/verilog-mode-version "\1-GNU"/g' \
| sed 's/verilog-mode-release-emacs nil/verilog-mode-release-emacs t/g' \
> verilog-mode-tognu.el
######################################################################
# Clean
clean::
/bin/rm -rf .timestamps e x test_dir verilog-mode.patch verilog-mode-tognu.el *.info