commit 64a1c9cb7d8bbc3934115dc13c72e45afa85a2e8 parent 53b6f217223d1ff8432c46668feefff341d24bff Author: Bharatvaj Hemanth <bharatvaj@yahoo.com> Date: Sun, 25 Dec 2022 20:23:08 +0530 Merge pull request #1 from wael444/main add proper targets Diffstat:
M | Makefile | | | 18 | ++++++++---------- |
M | config.mk | | | 6 | +++--- |
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,20 +1,18 @@ include config.mk -PROGRAM = fmake +all: fmake -SRC = $(PROGRAM).c - -all: $(PROGRAM) - -$(PROGRAM): $(SRC) config.h +fmake: fmake.c clean: - rm $(PROGRAM) + rm -f fmake -install: $(PROGRAM) - cp $(PROGRAM) $(DESTDIR)/$(PREFIX) +install: fmake + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f fmake $(DESTDIR)$(PREFIX)/bin + chmod 755 $(DESTDIR)$(PREFIX)/bin/fmake test: - @./$(PROGRAM) ENABLE_DEBUG=1 + @./fmake ENABLE_DEBUG=1 .PHONY: all test clean diff --git a/config.mk b/config.mk @@ -1,4 +1,4 @@ -VERSION := 0.1.1 +VERSION = 0.1.1 -CFLAGS := -DFMAKE_VERSION=$(VERSION) -PREFIX ?= usr/local/bin +CPPFLAGS += -DFMAKE_VERSION=$(VERSION) +PREFIX ?= /usr/local