2024-03-01 00:21:20 -08:00
|
|
|
# -*- mode: makefile -*-
|
|
|
|
.include "config.mk"
|
|
|
|
|
2024-02-23 17:55:56 -08:00
|
|
|
CC=clang
|
2024-03-05 00:54:32 -08:00
|
|
|
CFLAGS=-g -std=c11 -Wall ${SQLITE3_CFLAGS}
|
2024-02-23 17:55:56 -08:00
|
|
|
LD=clang
|
2024-04-01 13:56:24 -07:00
|
|
|
LDFLAGS=-lgpio -lfigpar -lgeom -lpthread ${SQLITE3_LDFLAGS}
|
|
|
|
SRCS=src/main.c src/util.c src/lcd.c src/ths.c src/button.c src/ui/screen.c\
|
|
|
|
src/ui/datesel.c src/ui/statsby.c
|
2024-02-28 05:31:35 -08:00
|
|
|
PROG=rpi4b-temp-humidity
|
2024-02-23 17:55:56 -08:00
|
|
|
|
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-04-01 13:56:24 -07:00
|
|
|
bin/main.o bin/util.o bin/lcd.o bin/ths.o bin/button.o: src/util.h
|
|
|
|
bin/ui/screen.o bin/ui/statsby.o bin/ui/datesel.o: src/util.h
|
|
|
|
|
|
|
|
bin/main.o bin/lcd.o bin/screen.o bin/ui/datesel.o: src/lcd.h
|
|
|
|
bin/ui/statsby.o: src/lcd.h
|
|
|
|
|
|
|
|
bin/main.o bin/ths.o bin/ui/screen.o bin/ui/statsby.o: src/ths.h
|
|
|
|
bin/main.o bin/button.o bin/ui/screen.o: src/button.h
|
|
|
|
bin/main.o bin/ui/screen.o bin/ui/statsby.o bin/ui/datesel.o: src/ui/screen.h
|
|
|
|
bin/main.o bin/ui/datesel.o bin/ui/statsby.o: src/ui/datesel.h
|
|
|
|
bin/main.o bin/ui/statsby.o: src/ui/statsby.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/}
|
2024-04-01 13:56:24 -07:00
|
|
|
@mkdir -p ${.TARGET:H}
|
2024-02-25 23:59:26 -08:00
|
|
|
${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}"\
|
2024-03-01 05:43:37 -08:00
|
|
|
-DDEFAULT_DATABASE_LOCATION="\"${DEFAULT_DATABASE_LOCATION}\""\
|
2024-02-28 12:09:18 -08:00
|
|
|
-DDEFAULT_REFRESH_TIME="${DEFAULT_REFRESH_TIME}"\
|
2024-03-01 00:21:20 -08:00
|
|
|
-o ${@} ${.TARGET:C/^bin/src/:C/.o$/.c/}
|
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
|