From: Erik de Castro Lopo Date: Fri, 10 Jun 2016 23:49:50 +0000 (+1000) Subject: Makefile: Add minimal C compiler warning flags X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=d0837f4390713968fe36b38ecbcb7c64680f6adf;p=liskon_frotz.git Makefile: Add minimal C compiler warning flags --- diff --git a/Makefile b/Makefile index 539fb71..46fce59 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ RANLIB = /usr/bin/ranlib CC = gcc #CC = cc +# Enable compiler warnings. This is ab absolute minimum. +CFLAGS += -Wall -Wextra + # Define your optimization flags. Most compilers understand -O and -O2, # Standard (note: Solaris on UltraSparc using gcc 2.8.x might not like this.) # @@ -224,19 +227,19 @@ all: $(NAME) d$(NAME) .SUFFIXES: .c .o .h $(COMMON_OBJECT): %.o: %.c - $(CC) $(OPTS) $(COMMON_DEFS) -o $@ -c $< + $(CC) $(CFLAGS) $(OPTS) $(COMMON_DEFS) -o $@ -c $< $(BLORB_OBJECT): %.o: %.c - $(CC) $(OPTS) -o $@ -c $< + $(CC) $(CFLAGS) $(OPTS) -o $@ -c $< $(DUMB_OBJECT): %.o: %.c - $(CC) $(OPTS) -o $@ -c $< + $(CC) $(CFLAGS) $(OPTS) -o $@ -c $< $(CURSES_OBJECT): %.o: %.c - $(CC) $(OPTS) $(CURSES_DEFS) $(INCL) -o $@ -c $< + $(CC) $(CFLAGS) $(OPTS) $(CURSES_DEFS) $(INCL) -o $@ -c $< $(SDL_OBJECT): %.o: %.c - $(CC) $(OPTS) $(SDL_DEFS) $(INCL) -o $@ -c $< + $(CC) $(CFLAGS) $(OPTS) $(SDL_DEFS) $(INCL) -o $@ -c $< # If you're going to make this target manually, you'd better know which