forked from ryanarn/powerabi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
101 lines (80 loc) · 2.76 KB
/
Makefile.in
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
ifneq (,)
This Makefile requires GNU Make.
endif
top_srcdir := @top_srcdir@
top_builddir = .
release = @release@
version = @version@
publish = @publish@
bitness = @bitness@
attributes = @attributes@
tags = @tags@
unifiedabi = @unifiedabi@
linuxabi = @linuxabi@
embeddedabi = @embeddedabi@
ifeq ($(attributes), yes)
wrapper := -i WRAPPER
else
wrapper :=
endif
ifeq ($(tags), yes)
tagid := -i TAGID
else
tagid :=
endif
ifeq ($(release), no)
draft := -i DRAFT
draft_title += $(shell date +'%F')-DRAFT-
else
draft :=
draft_title :=
endif
clean:
rm -f $(top_builddir)/ABI_entities.sgml
rm -f *.pdf
.PHONY: clean
distclean:
rm -f $(top_builddir)/config.log
rm -f $(top_builddir)/config.status
rm -f Makefile
rm -rf autom4te.cache/
.PHONY: distclean
linux: $(top_builddir)/ABI_entities.sgml
jw -b pdf $^ -d 'abi.dsl#print' -i LINUX $(draft) $(wrapper) $(tagid)
mv ABI_entities.pdf $(draft_title)Power-Arch-$(bitness)-bit-ABI-supp-$(version)[email protected]
embedded: $(top_builddir)/ABI_entities.sgml
jw -b pdf $^ -d 'abi.dsl#print' -i EMBEDDED $(draft) $(wrapper) $(tagid)
mv ABI_entities.pdf $(draft_title)Power-Arch-$(bitness)-bit-ABI-supp-$(version)[email protected]
unified: $(top_builddir)/ABI_entities.sgml
jw -b pdf $^ -d 'abi.dsl#print' -i UNIFIED $(draft) $(wrapper) $(tagid)
mv ABI_entities.pdf $(draft_title)Power-Arch-$(bitness)-bit-ABI-supp-$(version)[email protected]
targets: $(unifiedabi) $(linuxabi) $(embeddedabi)
powerabi: $(top_builddir)/ABI_entities.sgml targets
# We want $(top_builddir)/ABI_entities.sgml to be rebuilt after a new configure.
.PHONY: powerabi
all: powerabi
# DSSSL doesn't allow entities to be specified outside of the root level document.
# So in order to be able to dynamically specify some of these entity variables
# we have to do it here, and generate the root level document.
$(top_builddir)/ABI_entities.sgml:
@echo "Generating ABI_entites.sgml"
@echo '<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[' > $@
@echo '<!entity specversion "$(version)">' >> $@
ifeq ($(publish),yes)
@echo '<!entity publishdate "'`date +"%B %d, %Y"`'">' >> $@
else
@echo '<!entity publishdate "------ --, 20--">' >> $@
endif
@echo '<!entity archtitle "Power Architecture">' >> $@
@echo '<!entity abititle "$(bitness)-bit Application Binary Interface Supplement">' >> $@
@echo '<!entity BOOK SYSTEM "book-elfabi.sgml">' >> $@
@echo '<!entity INTRO SYSTEM "chap1-elf32abi.sgml">' >> $@
@echo '<!entity INSTALL SYSTEM "chap2-elf32abi.sgml">' >> $@
@echo '<!entity LOW-LEVEL SYSTEM "chap3-elf32abi.sgml">' >> $@
@echo '<!entity OBJ-FILES SYSTEM "chap4-elf32abi.sgml">' >> $@
@echo '<!entity PROG-LOAD-DL SYSTEM "chap5-elf32abi.sgml">' >> $@
@echo '<!entity LIB SYSTEM "chap6-elf32abi.sgml">' >> $@
@echo ']>' >> $@
@echo '<book>' >> $@
@echo '&BOOK;' >> $@
@echo '</book>' >> $@