From: Mark Hansen Date: Sat, 16 May 2020 05:42:58 +0000 (+1000) Subject: Mark Makefiles that don't generate files as .PHONY X-Git-Tag: 2.44.1~56^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59b4e4d1589d7163f12b4f9e6c4c430429c36e6b;p=graphviz Mark Makefiles that don't generate files as .PHONY See https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html. These targets aren't the name of a file, they're just a name for some behaviour to run. Marking them as .PHONY ensures that even if a file called 'clean' or 'distclean' or 'all' or 'install' exists in the directory, the code will still be run. --- diff --git a/contrib/pangotest/Makefile b/contrib/pangotest/Makefile index 838581b44..57a2faa95 100644 --- a/contrib/pangotest/Makefile +++ b/contrib/pangotest/Makefile @@ -3,8 +3,10 @@ LDFLAGS = `pkg-config --libs pangocairo` pangotest: pangotest.c +.PHONY: test test: pangotest ./pangotest Ay Times 64 >`uname -s`.png +.PHONY: clean clean: rm -f pangotest *.png diff --git a/doc/docbook/Makefile b/doc/docbook/Makefile index 7f976a96a..8e077f85f 100644 --- a/doc/docbook/Makefile +++ b/doc/docbook/Makefile @@ -4,6 +4,7 @@ SRCS = \ src/graphviz_plugins.xml \ src/graphviz_scripting.xml +.PHONY: all all: html pdf dvi fo javahelp man pdf ps txt: $(SRCS) @@ -14,5 +15,6 @@ xhtml xhtml-nochunks html html-nochunks htmlhelp: $(SRCS) xmlto $@ -o $@ src/book.xml cp -rp src/imgs $@/ +.PHONY: clean clean: rm -rf xhtml xhtml-nochunks html html-nochunks htmlhelp book.* diff --git a/doc/dotguide/Makefile b/doc/dotguide/Makefile index 1a0af6426..2632a3a52 100644 --- a/doc/dotguide/Makefile +++ b/doc/dotguide/Makefile @@ -47,6 +47,7 @@ dotguide.bbl : dotguide.tex ../dotguide/graphdraw.bib dotguide.aux dotguide.aux : dotguide.tex $(GRAPHFILES) pdflatex dotguide +.PHONY: clean clean: rm -rf *.ps *.pdf *.log dotguide.aux dotguide.blg dotguide.bbl diff --git a/doc/dotty/Makefile b/doc/dotty/Makefile index 2d38af08b..b7b4947c2 100644 --- a/doc/dotty/Makefile +++ b/doc/dotty/Makefile @@ -12,7 +12,9 @@ dotty.bbl: bibtex dotty rm dotty.dvi +.PHONY: all all: dotty.bbl dotty.dvi +.PHONY: clean clean: rm -f *.aux *.log *.bbl *.blg *.ps *.dvi diff --git a/doc/dotty/figs/Makefile b/doc/dotty/figs/Makefile index f84022046..e6bd99ec6 100644 --- a/doc/dotty/figs/Makefile +++ b/doc/dotty/figs/Makefile @@ -15,7 +15,9 @@ PSS = d1.ps d2.ps d3.ps d4.ps d5.ps d6.ps d7.ps d8.ps dotty.ps fa1.ps fa2.ps ldbx.ps +.PHONY: all all: $(PSS) +.PHONY: clean clean: rm -rf *.ps diff --git a/doc/infosrc/Makefile b/doc/infosrc/Makefile index bd5a87159..0925d3f9c 100644 --- a/doc/infosrc/Makefile +++ b/doc/infosrc/Makefile @@ -102,8 +102,10 @@ INSTALL_FILES = $(HTML) $(DOTS) $(SGIF) $(AGIF) $(A2GIF) $(MGIF) $(XGIF) $(MJPG) .gv.png : dot -Tpng -o $@ $< +.PHONY: all all : $(HTML) $(GIF) $(MPNG) $(MJPG) +.PHONY: install install : all $(INSTALL) $(INSTALL_FILES) $(INSTALL_DIR) @@ -208,9 +210,11 @@ $(TAPERPNG) : mktapers.sh $(SPLINEPNG) : mksplines.sh ./mksplines.sh $@ +.PHONY: clean clean : rm -f mklang sdlshapes.ps sdlshapes.ppm html.html +.PHONY: distclean distclean : clean rm -f attrs.html colors.html output.html shapes.html lang.html arrows.html rm -f $(A2GIF) $(AGIF) $(SGIF) $(MJPG) $(MGIF) $(MPNG) shapes @@ -226,4 +230,3 @@ EXTRA_DIST = $(XGIF) mklang.y mkarrows.sh mkattrs.sh mkshapes.sh mkstyles.sh mkt colorlist.dot html1.dot html4.dot round.dot constraint.dot \ html2.dot mrecord.dot sdlshapes.dot fill.dot html3.dot record.dot \ attrs types X11 outputs eqn.gif plugins.gv - diff --git a/doc/lefty/Makefile b/doc/lefty/Makefile index 9aaef1524..5f59b348d 100644 --- a/doc/lefty/Makefile +++ b/doc/lefty/Makefile @@ -7,6 +7,7 @@ %.ps : %.dot dot -Tps $< -o $@ +.PHONY: all all: lefty.bbl lefty.dvi lefty.bbl: @@ -14,5 +15,6 @@ lefty.bbl: bibtex lefty rm lefty.dvi +.PHONY: clean clean: rm -f *.aux *.log *.bbl *.blg *.ps *.dvi diff --git a/doc/lefty/figs/Makefile b/doc/lefty/figs/Makefile index ed068ebc0..74abaa2dc 100644 --- a/doc/lefty/figs/Makefile +++ b/doc/lefty/figs/Makefile @@ -18,7 +18,9 @@ PSS = fig2tpa.ps fig2tpb.ps figboxinitial.ps figboxfinal.ps figfractalonea.ps figfractaloneb.ps figfractalmva.ps figfractalmvb.ps figfractaltracea.ps figfractaltraceb.ps figfractaltracec.ps figradixtree.ps figbigtree.ps figtria.ps figtrib.ps figdag.ps lefty.ps +.PHONY: all all: $(PSS) +.PHONY: clean clean: rm -rf *.ps diff --git a/doc/libgraph/Makefile b/doc/libgraph/Makefile index 712d94838..94fe3c248 100644 --- a/doc/libgraph/Makefile +++ b/doc/libgraph/Makefile @@ -2,6 +2,7 @@ TEX=latex PTEX=pdflatex DVI=dvips +.PHONY: all all : Agraph.pdf %.pdf : %.dot @@ -26,6 +27,7 @@ agmemread.tex : agmemread.c Agraph.aux : Agraph.tex $(TEX) Agraph +.PHONY: clean clean: rm -rf *.bbl *.aux *.dvi *.ps *.pdf *.log *.toc *.blg diff --git a/doc/libguide/Makefile b/doc/libguide/Makefile index 6971e317b..39f37ecd5 100644 --- a/doc/libguide/Makefile +++ b/doc/libguide/Makefile @@ -2,6 +2,7 @@ TEX=latex PTEX=pdflatex DVI=dvips +.PHONY: all all : libguide.pdf %.pdf : %.dot @@ -32,6 +33,7 @@ libguide.bbl : libguide.tex graphdraw.bib libguide.aux libguide.aux : libguide.tex $(TEX) libguide +.PHONY: clean clean: rm -rf *.bbl *.aux *.dvi *.ps *.pdf *.log *.toc *.blg diff --git a/doc/neato/Makefile b/doc/neato/Makefile index 4ec0a866a..c06a954e1 100644 --- a/doc/neato/Makefile +++ b/doc/neato/Makefile @@ -24,5 +24,6 @@ neato.bbl : neato.tex ../dotguide/graphdraw.bib neato.aux neato.aux : neato.tex $(GRAPHFILES) pdflatex neato +.PHONY: clean clean: rm -rf *.ps *.pdf *.log diff --git a/doc/smyrna/Makefile b/doc/smyrna/Makefile index 4253b6318..f2b5817ad 100644 --- a/doc/smyrna/Makefile +++ b/doc/smyrna/Makefile @@ -34,5 +34,6 @@ smyrna.bbl : smyrna.tex ../dotguide/graphdraw.bib smyrna.aux smyrna.aux : smyrna.tex $(GRAPHFILES) pdflatex smyrna +.PHONY: clean clean: rm -rf *.pdf *.log *.aux *.bbl *.blg *.log *.toc diff --git a/dot.demo/Makefile b/dot.demo/Makefile index 32520db09..da945f05c 100644 --- a/dot.demo/Makefile +++ b/dot.demo/Makefile @@ -1,6 +1,7 @@ CFLAGS=`pkg-config libgvc --cflags` -Wall -g -O2 LDFLAGS=`pkg-config libgvc --libs` +.PHONY: all all: dot demo simple example neatopack dot: dot.o @@ -9,5 +10,6 @@ simple: simple.o example: example.o neatopack: neatopack.o +.PHONY: clean clean: rm -rf *.o dot demo simple example neatopack *.png diff --git a/dot.demo/Makefile.builtins b/dot.demo/Makefile.builtins index 1aa3dfbcd..565cfe736 100644 --- a/dot.demo/Makefile.builtins +++ b/dot.demo/Makefile.builtins @@ -1,3 +1,4 @@ +.PHONY: all all: dot demo simple example ################################################ @@ -22,5 +23,6 @@ demo: demo.o builtins.o simple: simple.o builtins.o example: example.o builtins.o +.PHONY: clean clean: rm -rf *.o dot demo simple example *.png $(EXTRACLEAN) diff --git a/dot.demo/Makefile.python_wrapper b/dot.demo/Makefile.python_wrapper index 66e146a69..78abaaffa 100644 --- a/dot.demo/Makefile.python_wrapper +++ b/dot.demo/Makefile.python_wrapper @@ -1,3 +1,4 @@ +.PHONY: all all: gv_test.png ################################################ @@ -31,5 +32,6 @@ _gv.so: gv.o gv_python.o gv_python.cpp gv.py: gv.i swig -c++ -python -o gv_python.cpp gv.i +.PHONY: clean clean: rm -f gv.py gv_python.cpp _gv.so *.o gv_test.png $(EXTRACLEAN) diff --git a/dot.demo/Makefile.python_wrapper_builtins b/dot.demo/Makefile.python_wrapper_builtins index d5b8c8998..0e178743a 100644 --- a/dot.demo/Makefile.python_wrapper_builtins +++ b/dot.demo/Makefile.python_wrapper_builtins @@ -1,3 +1,4 @@ +.PHONY: all all: gv_test.png ################################################ @@ -35,5 +36,6 @@ _gv.so: gv.o gv_python.o builtins.o gv_python.cpp gv.py: gv.i swig -c++ -python -o gv_python.cpp gv.i +.PHONY: clean clean: rm -f gv.py gv_python.cpp _gv.so *.o gv_test.png $(EXTRACLEAN) diff --git a/lib/inkpot/test/Makefile b/lib/inkpot/test/Makefile index e76535e64..251e65047 100644 --- a/lib/inkpot/test/Makefile +++ b/lib/inkpot/test/Makefile @@ -32,6 +32,7 @@ inkpot_xlate.c: inkpot_xlate.h: ln -s ../inkpot_xlate.h +.PHONY: clean clean: rm -rf *.o inkpot inkpot.[ch] inkpot_scheme.[ch] \ inkpot_value.[ch] inkpot_xlate.[ch] diff --git a/macosx/build/Makefile.lion b/macosx/build/Makefile.lion index e76fbc9b8..72ca1a540 100644 --- a/macosx/build/Makefile.lion +++ b/macosx/build/Makefile.lion @@ -73,8 +73,10 @@ $(GV_DIR)/Makefile: $(GV_DIR)/configure +.PHONY: clean clean: $(MAKE) -C $(GV_DIR) clean +.PHONY: distclean distclean: $(MAKE) -C $(GV_DIR) distclean diff --git a/macosx/build/Makefile.mountainlion b/macosx/build/Makefile.mountainlion index 7095e1505..b89ae22cb 100644 --- a/macosx/build/Makefile.mountainlion +++ b/macosx/build/Makefile.mountainlion @@ -71,8 +71,10 @@ $(GV_DIR)/Makefile: $(GV_DIR)/configure @echo cd $(GV_DIR) && ./configure --enable-swig=no --disable-dependency-tracking --with-ipsepcola --with-quartz --with-smyrna=no --disable-perl --with-extra-includedir="$(PREFIX)/include" --with-extra-libdir="$(PREFIX)/lib" CFLAGS="-O2 $(ARCH)" CXXFLAGS="-O2 $(ARCH)" OBJCFLAGS="-O2 $(ARCH)" LDFLAGS="$(ARCH) -Wl,-dead_strip" GDLIB_CONFIG="$(PREFIX)/bin/gdlib-config" PKG_CONFIG="$(PREFIX)/bin/pkg-config" PKG_CONFIG_PATH="$(PREFIX)/lib/pkgconfig:/usr/X11/lib/pkgconfig" +.PHONY: clean clean: $(MAKE) -C $(GV_DIR) clean +.PHONY: distclean distclean: $(MAKE) -C $(GV_DIR) distclean diff --git a/macosx/build/Makefile.snowleopard b/macosx/build/Makefile.snowleopard index 2b4122673..a3b0d9e5b 100644 --- a/macosx/build/Makefile.snowleopard +++ b/macosx/build/Makefile.snowleopard @@ -71,8 +71,10 @@ $(GV_DIR)/Makefile: $(GV_DIR)/configure @echo cd $(GV_DIR) && ./configure --enable-swig=no --disable-dependency-tracking --with-ipsepcola --with-quartz --with-smyrna=no --disable-perl --with-extra-includedir="$(PREFIX)/include" --with-extra-libdir="$(PREFIX)/lib" CFLAGS="-O2 $(ARCH)" CXXFLAGS="-O2 $(ARCH)" OBJCFLAGS="-O2 $(ARCH)" LDFLAGS="$(ARCH) -Wl,-dead_strip" GDLIB_CONFIG="$(PREFIX)/bin/gdlib-config" PKG_CONFIG="$(PREFIX)/bin/pkg-config" PKG_CONFIG_PATH="$(PREFIX)/lib/pkgconfig:/usr/X11/lib/pkgconfig" +.PHONY: clean clean: $(MAKE) -C $(GV_DIR) clean +.PHONY: distclean distclean: $(MAKE) -C $(GV_DIR) distclean diff --git a/macosx/prebuild/Makefile.leopard b/macosx/prebuild/Makefile.leopard index 2799fef57..d7fed854e 100644 --- a/macosx/prebuild/Makefile.leopard +++ b/macosx/prebuild/Makefile.leopard @@ -94,6 +94,7 @@ uninstall: $(MAKE) -C $(FREETYPE_DIR) uninstall $(MAKE) -C $(PKGCONFIG_DIR) uninstall +.PHONY: clean clean: $(MAKE) -C $(JPEG_DIR) clean $(MAKE) -C $(TIFF_DIR) clean @@ -111,6 +112,7 @@ clean: $(MAKE) -C $(FREETYPE_DIR) clean $(MAKE) -C $(PKGCONFIG_DIR) clean +.PHONY: distclean distclean: $(MAKE) -C $(JPEG_DIR) distclean $(MAKE) -C $(TIFF_DIR) distclean diff --git a/macosx/prebuild/Makefile.lion b/macosx/prebuild/Makefile.lion index 16ca7bc2a..78345d5e8 100644 --- a/macosx/prebuild/Makefile.lion +++ b/macosx/prebuild/Makefile.lion @@ -93,6 +93,7 @@ uninstall: $(MAKE) -C $(FREETYPE_DIR) uninstall $(MAKE) -C $(PKGCONFIG_DIR) uninstall +.PHONY: clean clean: $(MAKE) -C $(JPEG_DIR) clean $(MAKE) -C $(TIFF_DIR) clean @@ -110,6 +111,7 @@ clean: $(MAKE) -C $(FREETYPE_DIR) clean $(MAKE) -C $(PKGCONFIG_DIR) clean +.PHONY: clean distclean: $(MAKE) -C $(JPEG_DIR) distclean $(MAKE) -C $(TIFF_DIR) distclean diff --git a/macosx/prebuild/Makefile.snowleopard b/macosx/prebuild/Makefile.snowleopard index 5ec5c15fb..d3457cf0b 100644 --- a/macosx/prebuild/Makefile.snowleopard +++ b/macosx/prebuild/Makefile.snowleopard @@ -95,6 +95,7 @@ uninstall: $(MAKE) -C $(FREETYPE_DIR) uninstall $(MAKE) -C $(PKGCONFIG_DIR) uninstall +.PHONY: clean clean: $(MAKE) -C $(JPEG_DIR) clean $(MAKE) -C $(TIFF_DIR) clean @@ -112,6 +113,7 @@ clean: $(MAKE) -C $(FREETYPE_DIR) clean $(MAKE) -C $(PKGCONFIG_DIR) clean +.PHONY: distclean distclean: $(MAKE) -C $(JPEG_DIR) distclean $(MAKE) -C $(TIFF_DIR) distclean diff --git a/macosx/prebuild/Makefile.tiger b/macosx/prebuild/Makefile.tiger index b3c7ca480..84d31b327 100644 --- a/macosx/prebuild/Makefile.tiger +++ b/macosx/prebuild/Makefile.tiger @@ -76,6 +76,7 @@ uninstall: $(MAKE) -C $(PKGCONFIG_DIR) uninstall $(MAKE) -C $(LIBXML2_DIR) uninstall +.PHONY: clean clean: $(MAKE) -C $(PANGO_DIR) clean $(MAKE) -C $(GLIB_DIR) clean @@ -91,6 +92,7 @@ clean: $(MAKE) -C $(PKGCONFIG_DIR) clean $(MAKE) -C $(LIBXML2_DIR) clean +.PHONY: distclean distclean: $(MAKE) -C $(PANGO_DIR) distclean $(MAKE) -C $(GLIB_DIR) distclean diff --git a/rtest2/Makefile b/rtest2/Makefile index 73fcfbdae..dcf5f8c38 100644 --- a/rtest2/Makefile +++ b/rtest2/Makefile @@ -1,8 +1,10 @@ +.PHONY: test test: tclsh test.tcl reference: tclsh test.tcl reference +.PHONY: clean clean: rm -rf test_results test_graphs test_reference diff --git a/windows/prebuild/Makefile b/windows/prebuild/Makefile index fde8643e1..a800ff37f 100755 --- a/windows/prebuild/Makefile +++ b/windows/prebuild/Makefile @@ -89,8 +89,10 @@ PANGO_DIR=$(call dirname, $(PANGO_URL)) BASE_CONFIG=--prefix=$(LOCAL) --disable-dependency-tracking --enable-static=no --enable-shared=yes PKG_CONFIG="$(LOCAL_BIN)/$(PKGCONFIG_BIN)" FLAG_CONFIG=CFLAGS="-O2 -mms-bitfields -I$(LOCAL_INCLUDE)" LDFLAGS="-L$(LOCAL_LIB)" +.PHONY: install install: $(LOCAL_LIB)/$(PANGO) $(LOCAL_LIB)/$(GD) $(LOCAL_BIN)/$(FLEX_BIN) $(LOCAL_BIN)/$(YACC_BIN) +.PHONY: uninstall uninstall: $(MAKE) -C $(PANGO_DIR) uninstall $(MAKE) -C $(GLIB_DIR) uninstall @@ -110,6 +112,7 @@ uninstall: rm -rf $(LOCAL_BIN)/flex++.exe rm -rf $(LOCAL_BIN)/$(YACC_BIN) +.PHONY: distclean distclean: $(MAKE) -C $(PANGO_DIR) distclean $(MAKE) -C $(GLIB_DIR) distclean @@ -625,9 +628,3 @@ $(UNZIP_BIN_EXE): @echo TRANSFERRING ZIP BIN... @echo $(WGET) $(UNZIP_BIN_URL) || rm -f $(UNZIP_BIN_EXE) - -# -# phony -# - -.PHONY: install uninstall clean distclean