From d0837f4390713968fe36b38ecbcb7c64680f6adf Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sat, 11 Jun 2016 09:49:50 +1000 Subject: [PATCH] Makefile: Add minimal C compiler warning flags --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 -- 2.34.1