-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
179 lines (137 loc) · 4.95 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
167
168
169
170
171
172
173
174
175
176
177
178
179
PREFIX ?= /usr/local
bindir = $(PREFIX)/bin
XSLDIR = $(bindir)/oscdoc_xsl
RESOURCESDIR = $(bindir)/oscdoc_res
MANDIR = $(PREFIX)/man/man1
BUILDDIR = build
SRC = src
BLD = build
LIB = lib
CSS = css
DOC = doc
default: build
all: build manpage
build:
@echo ""
@echo "oscdoc, building tree_dyna"
@echo "--------------------------"
@echo ""
@echo ""
mkdir -p $(BUILDDIR)
cp $(LIB)/archives/tree-1.7.0_dyna.tgz $(BUILDDIR)
cd $(BUILDDIR) && tar xfz tree-1.7.0_dyna.tgz && rm tree-1.7.0_dyna.tgz && cd tree-1.7.0_dyna && make
@echo ""
@echo "done."
@echo ""
manpage: $(DOC)/oscdoc.man.asciidoc
a2x --doctype manpage --format manpage $(DOC)/oscdoc.man.asciidoc
gzip -9 -f $(DOC)/oscdoc.1
info:
@echo ""
@echo "oscdoc"
@echo "------"
@echo ""
@echo "possible targets are:"
@echo ""
@echo " info (show make targets)"
@echo " build (extract and build tree_dyna (see lib/archives/))"
@echo " install (install oscdoc scripts, stylesheets, tree_dyna)"
@echo " uninstall (uninstall ..)"
@echo " clean (remove build)"
@echo ""
install:
@echo ""
@echo "installing oscdoc tools:"
@echo "------------------------"
@echo ""
@echo "oscdoc, osctxt0, oscdoc_aspect_map, oscdoc_aspect_graph"
@echo "tree_dyna, oscdoc_tree1"
@echo ""
@echo "DESTDIR: $(DESTDIR)"
@echo "bindir: $(bindir)"
@echo ""
@echo "'make install' needs to be run with root privileges, i.e."
@echo ""
@echo "sudo make install"
@echo ""
cd $(BUILDDIR)/tree-1.7.0_dyna && make install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
install -d $(DESTDIR)$(bindir)
install -m755 $(SRC)/oscdoc.sh $(DESTDIR)$(bindir)/oscdoc
install -m755 $(SRC)/oscdoc_common.sh $(DESTDIR)$(bindir)/oscdoc_common.sh
install -m755 $(SRC)/osctxt0.sh $(DESTDIR)$(bindir)/osctxt0
install -m755 $(SRC)/oscdoc_aspect_map.sh $(DESTDIR)$(bindir)/oscdoc_aspect_map
install -m755 $(SRC)/oscdoc_aspect_graph.sh $(DESTDIR)$(bindir)/oscdoc_aspect_graph
install -m755 $(SRC)/oscdoc_tree1.sh $(DESTDIR)$(bindir)/oscdoc_tree1
install -d $(DESTDIR)$(XSLDIR)
install -m644 $(SRC)/oschema2html.xsl $(DESTDIR)$(XSLDIR)/
install -m644 $(SRC)/oscdocindex.xsl $(DESTDIR)$(XSLDIR)/
install -m644 $(SRC)/osctxt0.xsl $(DESTDIR)$(XSLDIR)/
install -m644 $(SRC)/rewrite_message_paths.xsl $(DESTDIR)$(XSLDIR)/
install -m644 $(SRC)/merge_ext_ids.xsl $(DESTDIR)$(XSLDIR)/
install -m644 $(LIB)/xmlverbatim.xsl $(DESTDIR)$(XSLDIR)/
# install -m644 $(LIB)/base64encoder.xsl $(DESTDIR)$(bindir)/
# install -m644 $(LIB)/base64decoder.xsl $(DESTDIR)$(bindir)/
# install -m644 $(LIB)/datamap.xml $(DESTDIR)$(bindir)/
install -d $(DESTDIR)$(RESOURCESDIR)
install -m644 $(SRC)/oscdoc.js $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(CSS)/oscdoc.css $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(CSS)/xmlverbatim.css $(DESTDIR)$(RESOURCESDIR)/
cp -r $(CSS)/dynatree $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(LIB)/jquery-1.11.1.min.js $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(LIB)/ObjTree.js $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(LIB)/1pixel.png $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(LIB)/draft.png $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(LIB)/jquery.dynatree.min.js $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(LIB)/jquery-ui.custom.min.js $(DESTDIR)$(RESOURCESDIR)/
install -m644 $(DOC)/oscdoc.1.gz $(DESTDIR)$(MANDIR)/
@echo ""
@echo "use: oscdoc test_data/unit.xml /tmp"
@echo "use: osctxt0 test_data/unit.xml"
@echo ""
@echo "done."
@echo ""
uninstall:
@echo ""
@echo "uninstalling oscdoc tools"
@echo "-------------------------"
@echo ""
@echo "DESTDIR: $(DESTDIR)"
@echo "bindir: $(bindir)"
@echo ""
@echo "'make uninstall' needs to be run with root privileges, i.e."
@echo ""
@echo "sudo make uninstall"
@echo ""
cd $(BUILDDIR)/tree-1.7.0_dyna && make uninstall DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
rm -f $(DESTDIR)$(bindir)/oscdoc
rm -f $(DESTDIR)$(bindir)/oscdoc_common.sh
rm -f $(DESTDIR)$(bindir)/osctxt0
rm -f $(DESTDIR)$(bindir)/oscdoc_aspect_map
rm -f $(DESTDIR)$(bindir)/oscdoc_aspect_graph
rm -f $(DESTDIR)$(bindir)/oscdoc_tree1
rm -f $(DESTDIR)$(XSLDIR)/oschema2html.xsl
rm -f $(DESTDIR)$(XSLDIR)/oscdocindex.xsl
rm -f $(DESTDIR)$(XSLDIR)/osctxt0.xsl
rm -f $(DESTDIR)$(XSLDIR)/rewrite_message_paths.xsl
rm -f $(DESTDIR)$(XSLDIR)/merge_ext_ids.xsl
rm -f $(DESTDIR)$(XSLDIR)/xmlverbatim.xsl
-rmdir $(DESTDIR)$(XSLDIR)
rm -rf $(DESTDIR)$(RESOURCESDIR)/dynatree
rm -f $(DESTDIR)$(RESOURCESDIR)/oscdoc.js
rm -f $(DESTDIR)$(RESOURCESDIR)/oscdoc.css
rm -f $(DESTDIR)$(RESOURCESDIR)/xmlverbatim.css
rm -f $(DESTDIR)$(RESOURCESDIR)/jquery-1.11.1.min.js
rm -f $(DESTDIR)$(RESOURCESDIR)/ObjTree.js
rm -f $(DESTDIR)$(RESOURCESDIR)/1pixel.png
rm -f $(DESTDIR)$(RESOURCESDIR)/draft.png
rm -f $(DESTDIR)$(RESOURCESDIR)/jquery.dynatree.min.js
rm -f $(DESTDIR)$(RESOURCESDIR)/jquery-ui.custom.min.js
rm -f $(MANDIR)/oscdoc.1.gz
-rmdir $(DESTDIR)$(RESOURCESDIR)
-rmdir $(DESTDIR)$(bindir)
@echo ""
@echo "done."
@echo ""
clean:
rm -rf $(BUILDDIR)
.PHONY: all build clean install uninstall