rpi4b-temp-humidity/Makefile

37 lines
916 B
Makefile
Raw Normal View History

2024-02-23 17:55:56 -08:00
CC=clang
2024-02-28 12:09:18 -08:00
CFLAGS=-std=c99 -Wall
2024-02-23 17:55:56 -08:00
LD=clang
LDFLAGS=-lgpio -lfigpar
2024-02-28 12:09:18 -08:00
SRCS=src/main.c src/util.c src/lcd.c src/ths.c src/button.c
2024-02-28 05:31:35 -08:00
PROG=rpi4b-temp-humidity
2024-02-23 17:55:56 -08:00
.include "config.mk"
2024-02-28 05:31:35 -08:00
OBJS=${SRCS:C/^src/bin/:C/.c$/.o/}
bin/${PROG}: ${OBJS}
${LD} ${LDFLAGS} -o ${@} ${OBJS}
2024-02-23 17:55:56 -08:00
2024-02-28 12:09:18 -08:00
main.o util.o lcd.o ths.o button.o: util.h
2024-02-23 22:56:10 -08:00
main.o lcd.o: lcd.h
main.o ths.o: ths.h
2024-02-28 12:09:18 -08:00
main.o button.o: button.h
2024-02-23 22:56:10 -08:00
2024-02-28 05:31:35 -08:00
${OBJS}: ${.TARGET:C/^bin/src/:C/.o$/.c/}
@mkdir -p bin/
${CC} ${CFLAGS} -c\
-DDEFAULT_CONFIG_PATH="\"${DEFAULT_CONFIG_PATH}\""\
-DDEFAULT_GPIO_DEVICE="\"${DEFAULT_GPIO_DEVICE}\""\
-DDEFAULT_TEMP_KEY="\"${DEFAULT_TEMP_KEY}\""\
-DDEFAULT_HUMID_KEY="\"${DEFAULT_HUMID_KEY}\""\
-DDEFAULT_FAIL_KEY="\"${DEFAULT_FAIL_KEY}\""\
-DDEFAULT_FAIL_LIMIT="${DEFAULT_FAIL_LIMIT}"\
-DDEFAULT_LCD_VERSION="\"${DEFAULT_LCD_VERSION}\""\
2024-02-28 12:09:18 -08:00
-DDEFAULT_REFRESH_TIME="${DEFAULT_REFRESH_TIME}"\
2024-02-28 05:31:35 -08:00
-o ${@} ${.ALLSRC}
2024-02-23 17:55:56 -08:00
2024-02-23 22:56:10 -08:00
clean:
2024-02-28 05:31:35 -08:00
rm -rf bin/
2024-02-23 22:56:10 -08:00
2024-02-23 17:55:56 -08:00
.SUFFIXES: .c .o
.PHONY: clean