From bf543f3f032b216c023456e41b9f7cb79fe9e675 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 28 Apr 2021 11:50:53 +0200 Subject: [PATCH] more use of pkg-config --- sink/Makefile | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sink/Makefile b/sink/Makefile index 8c11c7e..18be71c 100644 --- a/sink/Makefile +++ b/sink/Makefile @@ -6,23 +6,15 @@ sink20169.c \ logging.c -C_INCLUDES = \ --I. \ -$(shell pkg-config --cflags-only-I libpq) VERSION := $(shell git rev-parse --short=8 HEAD) +UNAME_S := $(shell uname -s) CC = gcc -CFLAGS = $(C_INCLUDES) -Wall -Werror -std=c99 -DVERSION="\"$(VERSION)\"" -LDFLAGS = -lconfig -lpq +CFLAGS = $(shell pkg-config --cflags libpq libconfig) -I. -Wall -Werror -std=c99 -D$(UNAME_S)=1 -DVERSION="\"$(VERSION)\"" +LDFLAGS = $(shell pkg-config --libs libpq libconfig) 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) OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))