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 *.o

