aboutsummaryrefslogtreecommitdiff
path: root/devel/simpleini/files/patch-tests_Makefile
blob: 943dd9682db26093a4569ee2efb2488ddcc21a8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- tests/Makefile.orig	2022-03-15 20:36:43 UTC
+++ tests/Makefile
@@ -1,14 +1,13 @@
-CC=g++
-CFLAGS=-Wall -std=c++11
-CPPFLAGS=-Wall -std=c++11
-LDFLAGS=-lpthread -lgtest -lgtest_main -lpthread -L/usr/lib -L/usr/lib/x86_64-linux-gnu
+CXX?=g++
+CXXFLAGS+=-Wall -std=c++11 `pkg-config --cflags gtest_main`
+LDFLAGS=`pkg-config --libs gtest_main`
 
 OBJS=ts-roundtrip.o ts-snippets.o ts-utf8.o ts-bugfix.o ts-quotes.o ts-noconvert.o
 
 BIN=./tests
 
-all: $(OBJS)
-	$(CC) -o $(BIN) $(OBJS) $(LDFLAGS)
+$(BIN): $(OBJS)
+	$(CXX) -o $(BIN) $(OBJS) $(LDFLAGS)
 
 clean:
 	rm -f core $(OBJS) $(BIN)