aboutsummaryrefslogtreecommitdiff
path: root/misc/lppf/Makefile.diff
blob: 14edb1f20258aebd005227c77762b60bd28ebb2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff -Naur lppf-0.1-rc1/Makefile lppf-0.1-rc1.patched/Makefile
--- lppf-0.1-rc1/Makefile	2008-01-11 12:07:27.000000000 -0500
+++ lppf-0.1-rc1.patched/Makefile	2024-09-01 15:40:45.029466905 -0400
@@ -4,13 +4,17 @@
 TARGET = lppf
 OBJS = libppf.o lppf.o ppf.o
 CC = g++
-CFLAGS=-Wall -ansi -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+MAINT_CFLAGS = -Wall -ansi -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 LINK = $(CC) -lm -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 VPATH = ./src
 
+PREFIX ?= /usr/local
+BINDIR ?= $(PREFIX)/bin
+DOCDIR ?= $(PREFIX)/share/doc/$(TARGET)
+
 .SUFFIXES:
 .SUFFIXES: .d .o .hh .cc
-.cc.o: ; $(CC) $(CFLAGS) -c $(VPATH)/$*.cc
+.cc.o: ; $(CC) $(CFLAGS) $(MAINT_CFLAGS) -c $(VPATH)/$*.cc
 
 %.d: %.hh %.cc
 	touch $@
@@ -22,6 +26,21 @@
 $(TARGET): $(OBJS)
 	$(LINK) -o $(TARGET) $(OBJS) $(LFLAGS)
 
+install:
+	-mkdir -p $(DESTDIR)$(BINDIR)
+	-mkdir -p $(DESTDIR)$(DOCDIR)
+	-install -m 0755 $(TARGET) $(DESTDIR)$(BINDIR)
+	-install -m 0644 AUTHORS $(DESTDIR)$(DOCDIR)
+	-install -m 0644 COPYING $(DESTDIR)$(DOCDIR)
+	-install -m 0644 README $(DESTDIR)$(DOCDIR)
+
+uninstall:
+	-rm -f $(DESTDIR)$(BINDIR)/$(TARGET)
+	-rm -f $(DESTDIR)$(DOCDIR)/AUTHORS
+	-rm -f $(DESTDIR)$(DOCDIR)/COPYING
+	-rm -f $(DESTDIR)$(DOCDIR)/README
+	-rm -rf $(DESTDIR)$(DOCDIR)
+
 clean:
 	-rm -f $(TARGET) $(OBJS) $(DEPENDENCIES) make.dep