raspberrypi/gpio/Makefile

43 lines
963 B
Makefile
Raw Normal View History

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
2020-09-10 13:23:23 +08:00
all: $(BIN)
infrared: infrared.o
2020-09-10 13:23:23 +08:00
$(CC) $(CFLAGS) -o infrared $^ $(LIBS)
light: light.o
2020-09-10 13:23:23 +08:00
$(CC) $(CFLAGS) -o light $^ $(LIBS)
pin: pin.o
2020-09-10 13:23:23 +08:00
$(CC) $(CFLAGS) -o pin $^ $(LIBS)
sound: sound.o
2020-09-10 13:23:23 +08:00
$(CC) $(CFLAGS) -o sound $^ $(LIBS)
ultrasound: ultrasound.o
2020-09-10 13:23:23 +08:00
$(CC) $(CFLAGS) -o ultrasound $^ $(LIBS)
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