aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)