Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sanitize Makefile

  • Loading branch information...
commit 0adec130cf80819afcc2bf463e9c1e14912eef8b 1 parent 9cb11fa
@RichiH authored
Showing with 16 additions and 20 deletions.
  1. +16 −20 Makefile
  2. 0  roundup.sh → roundup
View
36 Makefile
@@ -14,16 +14,20 @@ config.mk:
include config.mk
sourcedir = .
-PROGRAMS = roundup
+PROGRAMS = roundup
DISTFILES = config.mk config.sh
+INSTALL_PREREQUISITES = man
@RichiH Owner
RichiH added a note

I consider a manpage a must-have for any installed program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
RONNS = $(wildcard doc/*.ronn)
ROFFS = $(RONNS:.ronn=)
+MANS = roundup.1 roundup.5
+
-SCRIPTS = roundup.sh $(wildcard *-test.sh)
+SCRIPTS = roundup $(wildcard *-test.sh)
CODE_DOCS = $(SCRIPTS:=.html)
-MAN_DOCS = $(RONNS:.ronn=.html)
-DOCS = index.html $(CODE_DOCS) $(MAN_DOCS)
+MAN_DOCS = $(RONNS:.ronn=.html)
+DOCS = index.html $(CODE_DOCS) $(MAN_DOCS)
all:: sup build
@@ -32,17 +36,12 @@ sup:
head -7 < README
echo "==========================================================="
-build: roundup
@RichiH Owner
RichiH added a note

Due to the rename, there is no 'roundup' to call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+build:
echo "roundup built at \`$(sourcedir)/roundup' ..."
echo "run \`make install' to install under $(bindir) ..."
echo "or, just copy the \`$(sourcedir)/roundup' file where you need it."
-roundup: roundup.sh FORCE
- $(SHELL) -n roundup.sh
- cp roundup.sh roundup
- chmod 0755 roundup
-
-test: roundup
+test:
@echo This is expected to fail \`make\`.
@echo
./roundup
@@ -73,13 +72,10 @@ else
endif
install: $(INSTALL_PREREQUISITES)
- test -f roundup
- mkdir -p "$(bindir)"
- cp roundup "$(bindir)/roundup"
- chmod 0755 $(bindir)/roundup
-
-install-man: man
- -for i in {1..9} ; do cp *.$$i $(mandir)/man$$i 2>/dev/null ; done
+ install -d "$(bindir)"
@RichiH Owner
RichiH added a note

install(1) is the canonical way to install things in a Makefile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ install -m 0755 roundup "$(bindir)"
+ install -d "$(mandir)"
+ install -m 0644 $(MANS) "$(mandir)"
.PHONY: pages
pages : doc
@@ -95,7 +91,7 @@ read: sup doc
$(BROWSER) ./roundup.html
clean:
- $(RM) -rf $(PROGRAMS) $(CODE_DOCS) $(MAN_DOCS) $(ROFFS) pages/
@RichiH Owner
RichiH added a note

Due to the rename, deleting PROGRAMS would be a bad idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ $(RM) -rf $(CODE_DOCS) $(MAN_DOCS) $(ROFFS) pages/
distclean: clean
$(RM) -rf $(DISTFILES)
@@ -104,4 +100,4 @@ distclean: clean
.SUFFIXES:
-.SILENT: build sup roundup test
+.SILENT: build sup test
View
0  roundup.sh → roundup
File renamed without changes

5 comments on commit 0adec13

@bmizerany

I would like to keep roundup.sh. I appreciate the fixes but don't want to muck much with the directory structure or naming of things. Do you mind a smaller patch with the other fixes; or better yet, much smaller patches with descriptions of what is being fixed and why so I don't make the same mistakes again.

@RichiH
Owner

"Compiling" roundup.sh to roundup is basically a no-op and the only effect is that you can't (easily) run make test. This change really makes sense.

I am not sure if breaking down the rest into smaller commits makes a lot of sense; the changes are self-contained and partially depend on each other. As "no commit breaks the build", breaking this down is prolly more work than just explaining the changes via IRC or mail.

@bmizerany

Whitespace fixes won't break the build. There is a lot of noise in here.
I appreciate the help but it would be easier to grok if the changes where separated.

I see a few things here:

  • Whitespace fixes
  • Rename roundup.sh
  • Fix/update man-page installation
  • Remove vestigial PROGRAMS
@RichiH
Owner

Agreed on the whitespace. I added annotations to the commit above. If that's not enough I will need to untangle the commits after sleeping.

Is there anything that's still unclear?

@bmizerany

Please untangle. Thank you.

Please sign in to comment.
Something went wrong with that request. Please try again.