raspberrypi/sensor-data-upload/Makefile

21 lines
417 B
Makefile
Raw Normal View History

2023-03-25 09:01:17 +08:00
CROSS_COMPILE ?=
CC := $(CROSS_COMPILE)gcc
STRIP := $(CROSS_COMPILE)strip
CFLAGS = -Wall -g -O3
LIB =
OBJ = sensor-upload
MYSQL_LIB := $(shell /opt/mysql/bin/mysql_config --libs)
MYSQL_CFLAGS := $(shell /opt/mysql/bin/mysql_config --cflags)
all: main.o
$(CC) $(CFLAGS) $(MYSQL_CFLAGS) -o $(OBJ) $^ $(MYSQL_LIB) $(LIB)
$(STRIP) $(OBJ)
.c.o:
$(CC) $(CFLAGS) $(MYSQL_CFLAGS) -c $<
clean:
rm -rf *.o
rm $(OBJ)