raspberrypi/gpio/Makefile

38 lines
834 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
BIN = infrared light pin sound ultrasound wind dht11 dht12 helement key_light
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)
.c.o:
$(CC) $(CFLAGS) -c $< $(LIBS)
clean:
rm -rf *.o
rm $(BIN)
2018-03-29 20:06:23 +08:00