Commit 43574213 authored by Giovanne Marcelo's avatar Giovanne Marcelo

improve makefile

parent 65d8cc61
CC = gcc
CFLAGS = -Wall -Wextra -Wconversion -fstack-protector -Wformat-security -g -O3 -pipe -march=native
CFLAGS = -std=c99 -g -O3 \
-pipe \
-ggdb3 -Wstrict-overflow=5 -fstack-protector-all \
-W -Wall -Wextra \
-Wbad-function-cast \
-Wcast-align \
-Wcast-qual \
-Wconversion \
-Wfloat-equal \
-Wformat-y2k \
-Winit-self \
-Winline \
-Winvalid-pch \
-Wmissing-declarations \
-Wmissing-field-initializers \
-Wmissing-format-attribute \
-Wmissing-include-dirs \
-Wmissing-noreturn \
-Wmissing-prototypes \
-Wnested-externs \
-Wnormalized=nfc \
-Wold-style-definition \
-Woverlength-strings \
-Wpacked \
-Wpadded \
-Wpointer-arith \
-Wredundant-decls \
-Wshadow \
-Wsign-compare \
-Wstack-protector \
-Wstrict-aliasing=2 \
-Wstrict-prototypes \
-Wundef \
-Wunsafe-loop-optimizations \
-Wvolatile-register-var \
-Wwrite-strings
LFLAGS = -lpq -ljansson
INCL = -I./include
SRC = ./src
......@@ -7,11 +42,14 @@ DEPS = ./include/db_api.h ./include/log.h ./include/main.h
OBJ = db_api.o log.o main.o
APP=recommender
all: $(APP)
@echo "Compiled!"
$(APP): $(OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS)
@$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS)
%.o: $(SRC)/%.c $(DEPS)
$(CC) $(CFLAGS) -c -o $@ $< $(INCL)
@$(CC) $(CFLAGS) -c -o $@ $< $(INCL)
clean:
rm -f $(OBJ) $(APP) core *~ ./include/*~ *.o .*.swp ./include/*.swp ./src/*.swp ./include/.*.swp ./src/.*.swp
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment