From 1982b8ef05ecf839a82792866c21219feb8fa7cc Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 4 Jan 2024 16:28:29 -0500 Subject: Compile as c99, link math lib, preparing for FP exceptions. --- Makefile | 12 +++++++++--- 1 file 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) -- cgit v1.2.3