2020-09-10 13:23:23 +08:00
|
|
|
CROSS_COMPILE ?=
|
|
|
|
CC := $(CROSS_COMPILE)gcc
|
|
|
|
STRIP := $(CROSS_COMPILE)strip
|
|
|
|
CFLAGS += -g -O2 -Wall
|
|
|
|
LIBS = -lwiringPi
|
2024-01-09 15:27:17 +08:00
|
|
|
BIN = infrared light pin sound ultrasound wind dht11 dht12 helement key_light ch4 pasco2v01
|
2018-09-11 22:35:16 +08:00
|
|
|
|
2020-09-10 13:23:23 +08:00
|
|
|
all: $(BIN)
|
2018-09-11 22:35:16 +08:00
|
|
|
|
|
|
|
infrared: infrared.o
|
2020-09-10 13:23:23 +08:00
|
|
|
$(CC) $(CFLAGS) -o infrared $^ $(LIBS)
|
2018-09-11 22:35:16 +08:00
|
|
|
light: light.o
|
2020-09-10 13:23:23 +08:00
|
|
|
$(CC) $(CFLAGS) -o light $^ $(LIBS)
|
2018-09-11 22:35:16 +08:00
|
|
|
pin: pin.o
|
2020-09-10 13:23:23 +08:00
|
|
|
$(CC) $(CFLAGS) -o pin $^ $(LIBS)
|
2018-09-11 22:35:16 +08:00
|
|
|
sound: sound.o
|
2020-09-10 13:23:23 +08:00
|
|
|
$(CC) $(CFLAGS) -o sound $^ $(LIBS)
|
2018-09-11 22:35:16 +08:00
|
|
|
ultrasound: ultrasound.o
|
2020-09-10 13:23:23 +08:00
|
|
|
$(CC) $(CFLAGS) -o ultrasound $^ $(LIBS)
|
2018-09-11 22:35:16 +08:00
|
|
|
wind: wind.o
|
2020-09-10 13:23:23 +08:00
|
|
|
$(CC) $(CFLAGS) -o wind $^ $(LIBS)
|
|
|
|
dht11: dht11.o
|
|
|
|
$(CC) $(CFLAGS) -o dht11 $^ $(LIBS)
|
|
|
|
dht12: dht12.o
|
|
|
|
$(CC) $(CFLAGS) -o dht12 $^ $(LIBS)
|
|
|
|
helement: helement.o
|
|
|
|
$(CC) $(CFLAGS) -o helement $^ $(LIBS)
|
|
|
|
key_light: key_light.o
|
|
|
|
$(CC) $(CFLAGS) -o key_light $^ $(LIBS)
|
|
|
|
|
2024-01-09 15:27:17 +08:00
|
|
|
ch4: ch4.o
|
|
|
|
$(CC) $(CFLAGS) -o ch4 $^ $(LIBS)
|
|
|
|
pasco2v01: pasco2v01.o
|
|
|
|
$(CC) $(CFLAGS) -o pasco2v01 $^ $(LIBS)
|
|
|
|
|
2020-09-10 13:23:23 +08:00
|
|
|
.c.o:
|
|
|
|
$(CC) $(CFLAGS) -c $< $(LIBS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf *.o
|
|
|
|
rm $(BIN)
|
2018-03-29 20:06:23 +08:00
|
|
|
|