hfingerd

[archived] hhvn.uk:79
git clone https://hhvn.uk/hfingerd
git clone git://hhvn.uk/hfingerd
Log | Files | Refs | LICENSE

makefile (831B)


      1 PREFIX	= /usr/local
      2 CC	?= cc
      3 OBJ	= main.o handler.o strlcpy.o
      4 BIN	= hfingerd
      5 LINK	= fingerd
      6 COMMIT  = `git log HEAD...HEAD~1 --pretty=format:%h`
      7 
      8 $(BIN): $(OBJ)
      9 	$(CC) -g $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ)
     10 
     11 .c.o:
     12 	$(CC) -g $(CFLAGS) $(LDFLAGS) -o $@ -c $<
     13 
     14 clean:
     15 	rm $(BIN) $(OBJ)
     16 
     17 install: $(BIN)
     18 	install -m0755 $(BIN) $(PREFIX)/bin/$(BIN)
     19 	sed "s/COMMIT/$(COMMIT)/" \
     20 		< $(BIN).8 \
     21 		> $(PREFIX)/share/man/man8/$(BIN).8
     22 	-ln -s $(PREFIX)/bin/$(BIN) $(PREFIX)/bin/$(LINK) \
     23 		2>/dev/null || true
     24 	-ln -s $(PREFIX)/share/man/man8/$(BIN).8 \
     25 		$(PREFIX)/share/man/man8/$(LINK).8 \
     26 		2>/dev/null || true
     27 
     28 uninstall:
     29 	-rm $(PREFIX)/bin/$(BIN)
     30 	-rm $(PREFIX)/share/man/man8/$(BIN).8
     31 	-[ -h $(PREFIX)/bin/$(LINK) ] && \
     32 		rm $(PREFIX)/bin/$(LINK)
     33 	-[ -h $(PREFIX)/share/man/man8/$(BIN).8 ] && \
     34 		rm $(PREFIX)/share/man/man8/$(BIN).8