]> git.tuebingen.mpg.de Git - lopsub.git/blobdiff - Makefile
build: Improve handling of compiler options.
[lopsub.git] / Makefile
index 31c2102a940a2ec372f78d5906e9da48852d6fc7..f7e19fb8901d98dbfd90965f521b892bc45cdc0e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -95,13 +95,16 @@ lsg_objs := lopsubgen.o lsg.o lopsubgen.lsg.o lopsub.o version.o
 liblopsub_objs := config_file.o lopsub.o version.o
 lopsubex_objs := lopsubex.o lopsubex.lsg.o $(liblopsub_objs)
 
+LLS_CFLAGS := -g -fPIC
+STRICT_CFLAGS := -Wall
+
 $(lsg_objs) $(liblopsub_objs) $(lopsubex_objs): %.o: %.c
 lopsubgen.o config_file.o:
-       $(CC) -g -c -fPIC -o $@ ${@:.o=.c}
+       $(CC) $(CPPFLAGS) $(LLS_CFLAGS) $(CFLAGS) -c -o $@ ${@:.o=.c}
 lsg1.o: lsg.c lsg.h
-       $(CC) -g -DSTAGE1 -Wall -c $< -o $@
+       $(CC) $(CPPFLAGS) $(LLS_CFLAGS) $(STRICT_CFLAGS) $(CFLAGS) -DSTAGE1 -c -o $@ $<
 %.o: %.c
-       $(CC) -Wall -I. -g -c -fPIC -o $@ $<
+       $(CC) -I. $(CPPFLAGS) $(LLS_CFLAGS) $(STRICT_CFLAGS) $(CFLAGS) -c -o $@ $<
 
 # linking
 lopsubgen-stage1: $(lsg1_objs)