Skip to content

Commit

Permalink
Makefile: use .PHONY, and allow using a different python3
Browse files Browse the repository at this point in the history
Mark targets that do not generate a file with .PHONY.

Allow using a different PYTHON3 interpreter for systems that install
python3 as python3.9 or similar like NetBSD.
  • Loading branch information
emanuele6 authored and bagder committed Apr 17, 2023
1 parent a7f9ca9 commit e2950fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,29 @@ PREFIX ?= /usr/local
BINDIR ?= $(DESTDIR)$(PREFIX)/bin
MANDIR ?= $(DESTDIR)$(PREFIX)/share/man/man1

INSTALL = install
INSTALL ?= install
PYTHON3 ?= python3

$(TARGET): $(OBJS)
$(CC) $(OBJS) -o $(TARGET) $(LDLIBS) $(LDFLAGS)

trurl.o:trurl.c version.h

.PHONY: install
install:
$(INSTALL) -d $(BINDIR)
$(INSTALL) -m 0755 $(TARGET) $(BINDIR)
$(INSTALL) -d $(MANDIR)
$(INSTALL) -m 0644 $(MANUAL) $(MANDIR)

.PHONY: clean
clean:
rm -f $(OBJS) $(TARGET)

.PHONY: test
test:
@python3 test.py
@$(PYTHON3) test.py

.PHONY: checksrc
checksrc:
./checksrc.pl trurl.c version.h

0 comments on commit e2950fb

Please sign in to comment.