32 lines
997 B
Makefile
32 lines
997 B
Makefile
CC = gcc
|
|
CFLAGS = -DVERSION=\"$(GIT_VERSION)\" -Werror -Wall -Wextra -pedantic -Wcast-align\
|
|
-Wcast-qual -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs\
|
|
-Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wundef -Wno-unused -Wno-variadic-macros\
|
|
-Wno-parentheses -fdiagnostics-show-option -Wconversion -Wswitch-default -Wvla -Wlong-long -Wredundant-decls\
|
|
-Wunreachable-code -Wduplicated-cond -Wnull-dereference -Wjump-misses-init -Wdouble-promotion\
|
|
-Wimplicit-fallthrough -Wduplicated-branches -Wrestrict
|
|
|
|
LDFLAGS = -std=gnu11 -lcurl -lconfuse -lcjson -lpthread -lrt
|
|
|
|
GIT_VERSION := $(shell git describe --dirty --always --tags)
|
|
|
|
SRC = $(wildcard *.c)
|
|
OBJ = $(SRC:.c=.o)
|
|
TARGET = acsreader
|
|
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(SRC)
|
|
rm -f $(OBJ) $(TARGET)
|
|
$(CC) -O2 $(CFLAGS) $(SRC) -o $@ $(LDFLAGS)
|
|
|
|
|
|
.PHONY: test
|
|
test:
|
|
@echo "testing build"
|
|
rm -f $(OBJ) $(TARGET)
|
|
$(CC) -O0 -g $(CFLAGS) -DTEST $(SRC) -o $(TARGET) $(LDFLAGS)
|
|
|
|
clean:
|
|
rm -f $(OBJ) $(TARGET)
|