# # pgpasswd Makefile # IDIR=$(shell pg_config --includedir) INCLUDES=-I$(IDIR) LDIR=$(shell pg_config --libdir) LINKLIBS=-L$(LDIR) CC=gcc EDIR=$(shell pg_config --bindir) EXE1 = chpasswd OBJ1 = chpasswd.o SRC1 = chpasswd.c EXE2 = resetpasswd OBJ2 = resetpasswd.o SRC2 = resetpasswd.c all: chpasswd resetpasswd $(EXE1): $(OBJ1) $(CC) $(INCLUDES) -o $(EXE1) $(OBJ1) $(LINKLIBS) -lpq -Wall $(OBJ1) : $(SRC1) $(CC) $(INCLUDES) $(INCLUDES)/server -c $(SRC1) -Wall $(EXE2): $(OBJ2) $(CC) $(INCLUDES) -o $(EXE2) $(OBJ2) $(LINKLIBS) -lpq -Wall $(OBJ2) : $(SRC2) $(CC) $(INCLUDES) $(INCLUDES)/server -c $(SRC2) -Wall install: sudo install $(EXE1) $(EDIR) sudo install $(EXE2) $(EDIR) clean distclean maintainer-clean: rm -f *passwd *.o pgxn: git archive --format zip --output ../pgxn/pgpasswd/pgpasswd-0.0.2.zip main