Krolyxon
Commit df71437

Branches

Refs →

nsxivdf71437

Always take {C,CPP,LD}FLAGS from environment

Our own default values go into accompanying macros prefixed with DEF_.
Author
Bert Münnich
Date
2017-10-22 12:23 +0200
Committer
Bert Münnich · 2017-10-22 12:26 +0200
Parent
4d2fc0b
Commit
df714376c5594cba604a7f879eca34b0c7e0abff

+9 −9

1 file changed

  1. M Makefile +9 −9
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20171019
1+VERSION = git-20171022
22
33 srcdir = .
44 VPATH = $(srcdir)
@@ -6,10 +6,9 @@ VPATH = $(srcdir)
66 PREFIX = /usr/local
77 MANPREFIX = $(PREFIX)/share/man
88
9−CC ?= cc
10−CFLAGS += -std=c99 -Wall -pedantic
11−CPPFLAGS += -I/usr/include/freetype2
12−LDFLAGS +=
9+CC = cc
10+DEF_CFLAGS = -std=c99 -Wall -pedantic
11+DEF_CPPFLAGS = -I/usr/include/freetype2
1312
1413 # autoreload backend: inotify/nop
1514 AUTORELOAD = inotify
@@ -20,9 +19,10 @@ HAVE_GIFLIB = 1
2019 # enable features requiring libexif (-lexif)
2120 HAVE_LIBEXIF = 1
2221
22+ALL_CFLAGS = $(DEF_CFLAGS) $(CFLAGS)
2323 REQ_CPPFLAGS = -I. -D_XOPEN_SOURCE=700 -DVERSION=\"$(VERSION)\" \
2424 -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF)
25−ALL_CPPFLAGS = $(REQ_CPPFLAGS) $(CPPFLAGS)
25+ALL_CPPFLAGS = $(REQ_CPPFLAGS) $(DEF_CPPFLAGS) $(CPPFLAGS)
2626
2727 LIB_EXIF_0 =
2828 LIB_EXIF_1 = -lexif
@@ -42,16 +42,16 @@ all: sxiv
4242 .SUFFIXES: .c .o
4343 $(V).SILENT:
4444
45−sxiv: $(OBJS)
45+sxiv: $(OBJS)
4646 @echo "LINK $@"
47− $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
47+ $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $(OBJS) $(LDLIBS)
4848
4949 $(OBJS): Makefile sxiv.h commands.lst config.h
5050 window.o: icon/data.h
5151
5252 .c.o:
5353 @echo "CC $@"
54− $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
54+ $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
5555
5656 config.h:
5757 @echo "GEN $@"