Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 126 lines (103 sloc) 2.382 kB
2cce0fd @rtomayko use .sh extension and more idiomatic use of make
authored
1 # pgem makefile
2 .POSIX:
3
b7b3db5 @rtomayko get a Makefile going
authored
4 # Default make target
5 all::
6
7 NAME = pgem
8 TARNAME = $(NAME)
9 SHELL = /bin/sh
10
11 srcdir = .
12 prefix = /usr/local
13 exec_prefix = ${prefix}
14 bindir = ${exec_prefix}/bin
15 libexecdir = ${exec_prefix}/libexec
16 datarootdir = ${prefix}/share
17 datadir = ${datarootdir}
18 mandir = ${datarootdir}/man
19 docdir = $(datadir)/doc/$(TARNAME)
20
3ca0906 @rtomayko fix up install and uninstall make targets
authored
21 # Change this to `install-standalone' if you want a single pgem command. By
22 # default, all pgem- commands are installed.
23 #
24 # NOTE: the standalone stuff doesn't work yet.
25 INSTALLMETHOD = install-multi
b7b3db5 @rtomayko get a Makefile going
authored
26
27 # ---- END OF CONFIGURATION ----
28
29 all:: build
30
2cce0fd @rtomayko use .sh extension and more idiomatic use of make
authored
31 SOURCES = pgem-sh-setup.sh \
32 pgem.sh \
33 pgem-config.sh \
34 pgem-deps.sh \
35 pgem-fetch.sh \
36 pgem-install.sh \
37 pgem-list.sh \
38 pgem-version-test.sh \
39 pgem-uninstall.sh \
40 pgem-build.sh \
41 pgem-env.sh \
42 pgem-update.sh \
43 pgem-resolve.sh
44
45 PROGRAMS = pgem-sh-setup \
46 pgem \
47 pgem-config \
48 pgem-deps \
49 pgem-fetch \
50 pgem-install \
51 pgem-list \
52 pgem-version-test \
53 pgem-uninstall \
54 pgem-build \
55 pgem-env \
56 pgem-update \
57 pgem-resolve
58
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
59 DOCHTML = pgem-sh-setup.html \
60 pgem.html \
61 pgem-config.html \
62 pgem-deps.html \
63 pgem-fetch.html \
64 pgem-install.html \
65 pgem-list.html \
66 pgem-version-test.html \
67 pgem-uninstall.html \
68 pgem-build.html \
69 pgem-env.html \
70 pgem-update.html \
71 pgem-resolve
b7b3db5 @rtomayko get a Makefile going
authored
72
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
73 STANDALONE = $(NAME)
b7b3db5 @rtomayko get a Makefile going
authored
74
2cce0fd @rtomayko use .sh extension and more idiomatic use of make
authored
75 .sh:
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
76 echo " SH $@"
2cce0fd @rtomayko use .sh extension and more idiomatic use of make
authored
77 $(SHELL) -n $<
78 cp $< $@
79 chmod +x $@
b7b3db5 @rtomayko get a Makefile going
authored
80
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
81 .sh.html:
82 echo " SHOCCO $@"
83 shocco $< > $@
84
2cce0fd @rtomayko use .sh extension and more idiomatic use of make
authored
85 build: $(PROGRAMS) $(STANDALONE)
86 echo " DONE $(NAME) built successfully. Ready to \`make install'."
b7b3db5 @rtomayko get a Makefile going
authored
87
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
88 doc: $(DOCHTML)
89
b7b3db5 @rtomayko get a Makefile going
authored
90 pgem-sa:
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
91 echo " SHC $(STANDALONE)"
2cce0fd @rtomayko use .sh extension and more idiomatic use of make
authored
92 $(SHELL) shc -m pgem $(SOURCES) > $(STANDALONE) || { \
b7b3db5 @rtomayko get a Makefile going
authored
93 rm -f $(STANDALONE); \
94 false; \
95 }; \
96 chmod 0755 $(STANDALONE)
97
98 install: $(INSTALLMETHOD)
99
100 install-standalone:
101 mkdir -p $(bindir)
102 cp pgem-sa $(bindir)/pgem
103 chmod 0755 $(bindir)/pgem
104
105 install-multi:
2cce0fd @rtomayko use .sh extension and more idiomatic use of make
authored
106 mkdir -p $(bindir)
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
107 for f in $(PROGRAMS); do \
b7b3db5 @rtomayko get a Makefile going
authored
108 echo "installing: $$f"; \
3ca0906 @rtomayko fix up install and uninstall make targets
authored
109 cp $$f "$(bindir)/$$f" && \
b7b3db5 @rtomayko get a Makefile going
authored
110 chmod 0755 "$(bindir)/$$f"; \
111 done
112
113 uninstall:
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
114 for f in $(PROGRAMS); do \
3ca0906 @rtomayko fix up install and uninstall make targets
authored
115 test -e "$(bindir)/$$f" || continue; \
b7b3db5 @rtomayko get a Makefile going
authored
116 echo "uninstalling: $$f"; \
117 rm -f "$(bindir)/$$f"; \
118 done
119
120 clean:
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
121 echo $(STANDALONE) $(PROGRAMS) $(DOCHTML) | xargs -tn 1 rm -f
b7b3db5 @rtomayko get a Makefile going
authored
122
2cce0fd @rtomayko use .sh extension and more idiomatic use of make
authored
123 .SILENT:
8c7b165 @rtomayko pgem-resolve finds the best package given a set of version constraints
authored
124
3fda91e @rtomayko makefile uses implicit rules for .sh and .html shocco docs
authored
125 .SUFFIXES: .sh .html
Something went wrong with that request. Please try again.