21 lines
417 B
Makefile
21 lines
417 B
Makefile
|
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)
|