CCOPTS = -std=gnu18 -Wall -Werror -O2 CCGIT = $(shell pkg-config --libs libgit2) VERMAJOR = 0 VERMINOR = 1 VERPATCH = 1 all: build build: setup common modgit cc $(CCOPTS) \ -DVERMAJOR=$(VERMAJOR) -DVERMINOR=$(VERMINOR) -DVERPATCH=$(VERPATCH) \ obj/*.o $(CCGIT) src/main.c -o nullprompt common: setup cc $(CCOPTS) -c src/common.c -o obj/common.o modgit: setup common cc $(CCOPTS) -c src/modgit.c -o obj/modgit.o setup: if [ ! -d obj ]; then mkdir obj; fi install: build install -D -m 755 nullprompt $(DESTDIR)/usr/bin/nullprompt