чување 8be45c50f04e99ac03238f7712a2931a372892d9
родитељ 96a6e9cddd30bd7d0c6769f58086988aca8538cb
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Fri, 15 Mar 2024 20:55:42 +0100
Makefile: Add .POSIX; config.mk: Split CFLAGS -> CFLAGS+CPPFLAGS; -g -> -Os;
comment out CC by default; INSTALL: Revise OpenBSD section, remove gzip
optional requirement
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 4, додавања: 21(+), брисања: 17(-)
diff --git a/INSTALL b/INSTALL
@@ -1,13 +1,7 @@
Prerequisites
=============
-* C compiler defaults in config.mk
-
-
-Optional
---------
-
-* gzip (autodetected, for manpage compression)
+* C compiler - defaults in config.mk
Install
@@ -29,12 +23,17 @@ specified in config.mk.
OpenBSD
-------
-Replace gcc in CC with cc and add -D_BSD_SOURCE, eg:
+Before running make(1), comment the CPPFLAGS definition in config.mk above the
+line with the "OpenBSD" comment and uncomment the one below it:
- # CC='cc -g -Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=200809L
- -D_XOPEN_SOURCE=700 -D_BSD_SOURCE}' \
- make -e install
+ #CPPFLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L \
+ # -D_XOPEN_SOURCE=700
+ # OpenBSD
+ CPPFLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L \
+ -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
-and change MANPREFIX to
+Also, do the same for MANPREFIX:
- MANPREFIX=$PREFIX/man
+ #MANPREFIX = $(PREFIX)/share/man
+ # OpenBSD
+ MANPREFIX = $(PREFIX)/man
diff --git a/Makefile b/Makefile
@@ -1,3 +1,5 @@
+.POSIX:
+
include config.mk
.SUFFIXES: .1.in .1 .def.h .h.in .h .c .o
@@ -72,4 +74,4 @@ uninstall:
pack: all
sh -x lib/mkpack
-.PHONY: clean install makedate makeversion pack uninstall
+.PHONY: all clean install makedate makeversion pack uninstall
diff --git a/config.mk b/config.mk
@@ -1,8 +1,9 @@
-CC = cc
-CFLAGS = -g -Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=200809L \
+#CC = cc
+CFLAGS = -Os -Wall -pedantic -std=c99
+CPPFLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L \
-D_XOPEN_SOURCE=700
# OpenBSD
-#CFLAGS = -g -Wall -pedantic -std=c99 -D_POSIX_C_SOURCE=200809L \
+#CPPFLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L \
# -D_XOPEN_SOURCE=700 -D_BSD_SOURCE
INSTALL = install
LIBS =
diff --git a/examples/Makefile b/examples/Makefile
@@ -1,3 +1,5 @@
+.POSIX:
+
include ../config.mk
all: