Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
makefile uses implicit rules for .sh and .html shocco docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Mar 13, 2010
1 parent 2cce0fd commit 3fda91e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .gitignore
@@ -0,0 +1,28 @@
/config.mk
/config.sh
/pgem
/pgem-build
/pgem-config
/pgem-deps
/pgem-env
/pgem-fetch
/pgem-install
/pgem-list
/pgem-resolve
/pgem-sh-setup
/pgem-uninstall
/pgem-update
/pgem-version-test
/pgem-build.html
/pgem-config.html
/pgem-deps.html
/pgem-env.html
/pgem-fetch.html
/pgem-install.html
/pgem-list.html
/pgem-sa
/pgem-sh-setup.html
/pgem-uninstall.html
/pgem-update.html
/pgem-version-test.html
/pgem.html
33 changes: 26 additions & 7 deletions Makefile
Expand Up @@ -56,20 +56,39 @@ PROGRAMS = pgem-sh-setup \
pgem-update \
pgem-resolve

STANDALONE = $(NAME)
DOCHTML = pgem-sh-setup.html \
pgem.html \
pgem-config.html \
pgem-deps.html \
pgem-fetch.html \
pgem-install.html \
pgem-list.html \
pgem-version-test.html \
pgem-uninstall.html \
pgem-build.html \
pgem-env.html \
pgem-update.html \
pgem-resolve

CLEAN = $(STANDALONE) syntax
STANDALONE = $(NAME)

.sh:
echo " SH $@"
$(SHELL) -n $<
cp $< $@
chmod +x $@

.sh.html:
echo " SHOCCO $@"
shocco $< > $@

build: $(PROGRAMS) $(STANDALONE)
echo " DONE $(NAME) built successfully. Ready to \`make install'."

doc: $(DOCHTML)

pgem-sa:
echo " BUILD $(STANDALONE)"
echo " SHC $(STANDALONE)"
$(SHELL) shc -m pgem $(SOURCES) > $(STANDALONE) || { \
rm -f $(STANDALONE); \
false; \
Expand All @@ -85,22 +104,22 @@ install-standalone:

install-multi:
mkdir -p $(bindir)
for f in $(SOURCES); do \
for f in $(PROGRAMS); do \
echo "installing: $$f"; \
cp $$f "$(bindir)/$$f" && \
chmod 0755 "$(bindir)/$$f"; \
done

uninstall:
for f in $(SOURCES); do \
for f in $(PROGRAMS); do \
test -e "$(bindir)/$$f" || continue; \
echo "uninstalling: $$f"; \
rm -f "$(bindir)/$$f"; \
done

clean:
rm -f $(CLEAN)
echo $(STANDALONE) $(PROGRAMS) $(DOCHTML) | xargs -tn 1 rm -f

.SILENT:

.SUFFIXES: .sh
.SUFFIXES: .sh .html

0 comments on commit 3fda91e

Please sign in to comment.