diff --git a/Makefile b/Makefile index 5232e12..65daddd 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,15 @@ include config.mk +include sources.mk ifeq (${CC},clang) - -CFLAGS :=\ +CFLAGS =\ -std=c99\ -Weverything\ -Wno-padded\ -Wno-disabled-macro-expansion\ - -pedantic\ - ${CFLAGS} - + -pedantic else ifeq (${CC},gcc) - -CFLAGS :=\ +CFLAGS =\ -std=c99\ -Wall\ -Wextra\ @@ -29,13 +26,15 @@ CFLAGS :=\ -Wshadow\ -Wunsafe-loop-optimizations\ -Wparentheses\ - -pedantic\ - ${CFLAGS} - + -pedantic +endif + +ifeq (${DEBUG},1) +CFLAGS += -g +else +CFLAGS += -O2 endif -SRC = dynarray.c -HDR = dynarray.h OBJ = ${SRC:.c=.o} all: ${OBJ} diff --git a/config.mk b/config.mk index f83eb9f..71c6bed 100644 --- a/config.mk +++ b/config.mk @@ -1,3 +1,4 @@ -VERSION = 1.1.1 +VERSION = 1.1.2 PREFIX = /usr/local CC = clang +DEBUG = 1 diff --git a/sources.mk b/sources.mk new file mode 100644 index 0000000..00466ec --- /dev/null +++ b/sources.mk @@ -0,0 +1,2 @@ +SRC = dynarray.c +HDR = dynarray.h