Skip to content

Commit

Permalink
Fix .PHONY targets in Makefiles
Browse files Browse the repository at this point in the history
Phony targets should be dependencies of .PHONY, not the other way around.
  • Loading branch information
andy-morris committed Jan 11, 2014
1 parent ef0b6ec commit 23a28d5
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
check: .PHONY
check:
rm -f *.ibc
for x in *.idr ; do \
echo "Checking $$x"; \
idris --check $$x; \
done

.PHONY:
.PHONY: check
8 changes: 4 additions & 4 deletions libs/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
build: .PHONY
build:
$(MAKE) -C prelude build
$(MAKE) -C base build
$(MAKE) -C effects build
$(MAKE) -C javascript build


install: .PHONY
install:
$(MAKE) -C prelude install
$(MAKE) -C base install
$(MAKE) -C effects install
$(MAKE) -C javascript install

clean: .PHONY
clean:
$(MAKE) -C prelude clean
$(MAKE) -C base clean
$(MAKE) -C effects clean
$(MAKE) -C javascript clean

.PHONY:
.PHONY: build install clean
8 changes: 4 additions & 4 deletions libs/base/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
IDRIS := idris

build: .PHONY
build:
$(IDRIS) --build base.ipkg

install:
$(IDRIS) --install base.ipkg

clean: .PHONY
clean:
$(IDRIS) --clean base.ipkg

rebuild: clean build

linecount: .PHONY
linecount:
find . -name '*.idr' | xargs wc -l

.PHONY:
.PHONY: build install clean rebuild linecount
6 changes: 3 additions & 3 deletions libs/effects/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
IDRIS := idris

build: .PHONY
build:
$(IDRIS) --build effects.ipkg

clean: .PHONY
clean:
$(IDRIS) --clean effects.ipkg

install:
$(IDRIS) --install effects.ipkg

rebuild: clean build

.PHONY:
.PHONY: build clean install rebuild
6 changes: 3 additions & 3 deletions libs/javascript/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
IDRIS := idris

build: .PHONY
build:
$(IDRIS) --build javascript.ipkg

install:
$(IDRIS) --install javascript.ipkg

clean: .PHONY
clean:
$(IDRIS) --clean javascript.ipkg

rebuild: clean build

.PHONY:
.PHONY: build install clean rebuild
8 changes: 4 additions & 4 deletions libs/prelude/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
IDRIS := idris

build: .PHONY
build:
$(IDRIS) --build prelude.ipkg

install:
$(IDRIS) --install prelude.ipkg

clean: .PHONY
clean:
$(IDRIS) --clean prelude.ipkg

rebuild: clean build

linecount: .PHONY
linecount:
find . -name '*.idr' | xargs wc -l

.PHONY:
.PHONY: build install clean rebuild linecount
6 changes: 3 additions & 3 deletions llvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ $(LIB): $(OBJECTS)
.c.o:
$(CC) -c $(CFLAGS) $< -o $@

install: $(LIB) .PHONY
install: $(LIB)
mkdir -p $(TARGET)
install $(LIB) $(TARGET)

clean: .PHONY
clean:
rm -f $(OBJECTS) $(LIB)

.PHONY:
.PHONY: build install clean
10 changes: 5 additions & 5 deletions papers/impl-paper/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PAPER = impldtp

all: ${PAPER}.pdf .PHONY
all: ${PAPER}.pdf

TEXFILES = ${PAPER}.tex intro.tex conclusions.tex hll.tex\
typechecking.tex elaboration.tex delab.tex \
Expand Down Expand Up @@ -28,16 +28,16 @@ ${PAPER}.dvi: $(SOURCES)
-latex ${PAPER}
-latex ${PAPER}

progress: .PHONY
progress:
wc -w ${TEXFILES}

%.png : %.diag
$(DITAA) -o -E $<

todropbox: .PHONY
todropbox:
cp ${SOURCES} ~/Dropbox/TeX/ImplDTP/

fromdropbox: .PHONY
fromdropbox:
cp ~/Dropbox/TeX/ImplDTP/* .

.PHONY:
.PHONY: all progress todropbox fromdropbox
6 changes: 3 additions & 3 deletions rts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ $(LIBTARGET) : $(OBJS)
ar r $(LIBTARGET) $(OBJS)
ranlib $(LIBTARGET)

install : .PHONY
install :
mkdir -p $(TARGET)
install $(LIBTARGET) $(HDRS) $(TARGET)

clean : .PHONY
clean :
rm -f $(OBJS) $(LIBTARGET) $(DYLIBTARGET)

idris_rts.o: idris_rts.h

.PHONY:
.PHONY: build install clean
2 changes: 1 addition & 1 deletion support/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ install: check
install $(LIBTARGET) $(TARGET)
install $(HDRS) $(TARGET)

.PHONY:
.PHONY: check install
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ distclean:
rm -f *~
rm -f */output

.phony: test test_java test_js update diff distclean $(TESTS)
.PHONY: test test_java test_js update diff distclean $(TESTS)

0 comments on commit 23a28d5

Please sign in to comment.