我有一个现有的且可以运行的 Makefile,并且想要添加 MariaDB (mysql.h)。我的问题是:
gcc -o example MariaDBTest.c $(mariadb_config --include --libs)
运行良好。但是我如何/在哪里可以将其插入到我的 Makefile 中:
CC = gcc -Wno-unknown-pragmas -Wall -Wextra
PKGCONFIG = $(shell which pkg-config)
CFLAGS = $(shell $(PKGCONFIG) --cflags gtk+-3.0 --libs) -lbcm2835 -rdynamic -lm
DEPS = LinkedList.h StructDefinitions.h
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
OBJ = reTerminal.c \
Sensors/CpuGpuTemp.c Sensors/ReadSensores.c Sensors/TempSensorExtern.c \
Connectivity/ClientSide.c Connectivity/ServerSide.c \
GUI/MainApp.c GUI/MainAppWindow.c GUI/BasicFrame.c GUI/SimpleFrame.c \
Data/MariaDBTest.c
Main: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS)
系统:Linux/RasPi5