Danger-alarm/SOFTWARE/Server/hc-12/Makefile
2024-06-03 16:27:41 +08:00

22 lines
483 B
Makefile

CROSS_COMPILE ?=
CC = $(CROSS_COMPILE)gcc
STRIP := $(CROSS_COMPILE)strip
AR := $(CROSS_COMPILE)ar
CFLAGS += -g -Wall -Os
LDFLAGS += -lwiringPi
MYSQL_LIB := $(shell mysql_config --libs)
MYSQL_CFLAGS := $(shell mysql_config --cflags)
OBJ = hc-12
all: hc-12
hc-12: hc-12.o ../libconf/libconf.o mysql.o
$(CC) $(CFLAGS) $(MYSQL_CFLAGS) -o $(OBJ) $^ $(MYSQL_LIB) $(LDFLAGS)
.c.o:
$(CC) $(CFLAGS) $(MYSQL_CFLAGS) -c $< $@
clean:
rm hc-12 hc-12.o ../libconf/libconf.o mysql.o