File: makefile.patch

package info (click to toggle)
otp 1%3A1.2.2-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 232 kB
  • sloc: ansic: 1,068; makefile: 73; sh: 10
file content (49 lines) | stat: -rw-r--r-- 1,225 bytes parent folder | download | duplicates (2)
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
46
47
48
49
Description: Fix CFLAGS for hardening
Author: colint@debian.org
Last-Update: 2024-06-12
---
Index: otp-salsa/Makefile
===================================================================
--- otp-salsa.orig/Makefile	2024-06-12 05:33:24.958756331 +0200
+++ otp-salsa/Makefile	2024-06-12 05:33:48.270923535 +0200
@@ -1,7 +1,11 @@
+INSTALL = install
+DESTDIR =
+BINDIR = /usr/bin
+MAN1DIR = /usr/share/man/man1
 
 CC = gcc
 #CFLAGS = -g -DDEBUG
-CFLAGS = -O -Wall
+CFLAGS += -O -Wall
 
 VERSION = 1.2.2
 
@@ -11,7 +15,7 @@
 	md5.h otp.1 otp.c otp.exe random.c test.bat test.mas test.sh
 
 otp:	otp.o md5.o random.o
-	$(CC) $(CFLAGS) otp.o md5.o random.o -o otp
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) otp.o md5.o random.o -o otp
 
 manpage:
 	nroff -man otp.1 | $(PAGER)
@@ -22,6 +26,11 @@
 otp.man: otp.1
 	nroff -man otp.1 | col -b >otp.man
 
+install: otp
+	$(INSTALL) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(MAN1DIR)
+	$(INSTALL) otp $(DESTDIR)$(BINDIR)
+	$(INSTALL) otp.1 $(DESTDIR)$(MAN1DIR)
+
 dist:	clean
 	mkdir otp-$(VERSION)
 	cp -p $(FILES) otp-$(VERSION)
@@ -40,3 +49,6 @@
 	      *.obj *.pdb *.sbr *.bsc *.vcw *.bin t?*.md5 \
 	      *.gz *.tar
 	rm -rf otp-$(VERSION)
+	$(RM) test
+distclean: clean
+	$(RM) otp otp.exe