Introduce LLS_CFLAGS and STRICT_CFLAGS to avoid duplicating the flags
in the various cc recipes. We don't touch CFLAGS or CPPFLAGS in the
Makefile but include it the cc commands to let the user override
our settings.
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)