Description: Respect external CFLAGS and CPPFLAGS
authorviric <viriketo@gmail.com>
Sun, 20 Mar 2016 11:25:28 +0100
changeset 344 9be22a4aa695
parent 343 23242cea443d
child 345 c8fd555369d1
Description: Respect external CFLAGS and CPPFLAGS Author: Alexander Inyukhin <shurick@sectorb.msk.ru> Forwarded: yes Last-Update: 2012-06-09
Makefile
--- a/Makefile	Sun Mar 20 11:25:10 2016 +0100
+++ b/Makefile	Sun Mar 20 11:25:28 2016 +0100
@@ -1,6 +1,7 @@
 PREFIX?=/usr/local
 GLIBCFLAGS=-D_XOPEN_SOURCE=500 -D__STRICT_ANSI__
-CFLAGS=-pedantic -ansi -Wall -g -O0
+CPPFLAGS+=$(GLIBCFLAGS)
+CFLAGS?=-pedantic -ansi -Wall -g -O0
 OBJECTS=main.o \
 	server.o \
 	server_start.o \
@@ -32,7 +33,7 @@
 
 
 .c.o:
-	$(CC) $(CFLAGS) $(GLIBCFLAGS) -c $<
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
 
 # Dependencies
 main.o: main.c main.h