more use of pkg-config

This commit is contained in:
Wolfgang Hottgenroth 2021-04-28 11:50:53 +02:00
parent 9e84d5ead5
commit bf543f3f03
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -6,23 +6,15 @@ sink20169.c \
logging.c logging.c
C_INCLUDES = \
-I. \
$(shell pkg-config --cflags-only-I libpq)
VERSION := $(shell git rev-parse --short=8 HEAD) VERSION := $(shell git rev-parse --short=8 HEAD)
UNAME_S := $(shell uname -s)
CC = gcc CC = gcc
CFLAGS = $(C_INCLUDES) -Wall -Werror -std=c99 -DVERSION="\"$(VERSION)\"" CFLAGS = $(shell pkg-config --cflags libpq libconfig) -I. -Wall -Werror -std=c99 -D$(UNAME_S)=1 -DVERSION="\"$(VERSION)\""
LDFLAGS = -lconfig -lpq LDFLAGS = $(shell pkg-config --libs libpq libconfig)
TARGET = sink20169 TARGET = sink20169
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),OpenBSD)
CFLAGS += -I/usr/local/include -DOpenBSD=1
LDFLAGS += -L/usr/local/lib
endif
all: $(BUILD_DIR)/$(TARGET) all: $(BUILD_DIR)/$(TARGET)
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))