aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-01-04 16:28:29 -0500
committerB. Watson <urchlay@slackware.uk>2024-01-04 16:28:29 -0500
commit1982b8ef05ecf839a82792866c21219feb8fa7cc (patch)
tree3d5ab72cd16d391a9798f4ef8cde3e548c55293d /Makefile
parentaafee279877e0e9762f2852a3b2bbaeb2e4661fa (diff)
downloadhcalc-1982b8ef05ecf839a82792866c21219feb8fa7cc.tar.gz
Compile as c99, link math lib, preparing for FP exceptions.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a937a0d..441321e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,9 @@
# Makefile for hcalc. Requires GNU make.
-# Users and packagers, feel free to override these:
+# Users and packagers, feel free to override these.
+# Do not override CFLAGS! Use COPT instead.
CC = gcc
-CFLAGS = -Wall -g
+COPT =
LIBS =
DESTDIR =
PREFIX = /usr
@@ -33,6 +34,11 @@ GZIP = gzip
# - realclean is a maintainer-only target, deletes generated files that are
# in git.
+# -D_POSIX_C_SOURCE needed for fileno(), when using -std=c99
+#CFLAGS = -Wall -g -std=c99 -D_POSIX_C_SOURCE $(COPT)
+# -std=gnu99 works on gcc and clang.
+CFLAGS = -Wall -g -std=gnu99 $(COPT)
+
PROJ = hcalc
VERSION = 1.2u1
MANPAGE = $(PROJ).1
@@ -71,7 +77,7 @@ version.h: VERSION
echo '#define VERSION "$(VERSION)"' > version.h
$(PROJ): $(OBJS)
- $(CC) -o $@ $^ $(LDFLAGS) -lXpm -lX11 $(LIBS)
+ $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) -lXpm -lX11 -lm
$(MANPAGE): $(PROJ).rst version.rst
rst2man $(PROJ).rst > $(MANPAGE)