61 lines
2.1 KiB
Makefile
61 lines
2.1 KiB
Makefile
# -*- mode: makefile -*-
|
|
.include "config.mk"
|
|
|
|
CC=clang
|
|
CFLAGS=-g -std=c11 -Wall ${SQLITE3_CFLAGS}
|
|
LD=clang
|
|
LDFLAGS=-lgpio -lfigpar -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 src/ui/datapoints.c src/ui/timesel.c\
|
|
src/ui/statrange.c
|
|
PROG=rpi4b-temp-humidity
|
|
|
|
OBJS=${SRCS:C/^src/bin/:C/.c$/.o/}
|
|
bin/${PROG}: ${OBJS}
|
|
${LD} ${LDFLAGS} -o ${@} ${OBJS}
|
|
|
|
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/ui/datapoints.o bin/ui/timesel.o bin/ui/statrange.o: src/util.h
|
|
|
|
bin/main.o bin/lcd.o bin/screen.o bin/ui/datesel.o: src/lcd.h
|
|
bin/ui/statsby.o bin/ui/timesel.o bin/ui/statrange.o: src/lcd.h
|
|
bin/ui/datapoints.o: src/lcd.h
|
|
|
|
bin/main.o bin/ui/screen.o bin/ui/statsby.o: src/ui/screen.h
|
|
bin/ui/datesel.o bin/ui/datapoints.o bin/ui/timesel.o: src/ui/screen.h
|
|
bin/ui/statrange.o: src/ui/screen.h
|
|
|
|
bin/main.o bin/ui/datesel.o bin/ui/statsby.o: src/ui/datesel.h
|
|
bin/ui/datapoints.o bin/ui/timesel.o bin/ui/statrange.o: src/ui/datesel.h
|
|
|
|
bin/main.o bin/ths.o bin/ui/screen.o bin/ui/statsby.o: src/ths.h
|
|
bin/ui/timesel.o src/ui/statrange.o: src/ths.h
|
|
|
|
bin/main.o bin/ui/timesel.o bin/ui/datapoints.o: src/ui/timesel.h
|
|
bin/ui/statrange.o: src/ui/timesel.h
|
|
|
|
bin/main.o bin/button.o bin/ui/screen.o: src/button.h
|
|
bin/main.o bin/ui/statsby.o: src/ui/statsby.h
|
|
bin/main.o bin/ui/datapoints.o: src/ui/datapoints.h
|
|
bin/main.o bin/ui/statrange.o: src/ui/statrange.h
|
|
|
|
${OBJS}: ${.TARGET:C/^bin/src/:C/.o$/.c/}
|
|
@mkdir -p ${.TARGET:H}
|
|
${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_DATABASE_LOCATION="\"${DEFAULT_DATABASE_LOCATION}\""\
|
|
-DDEFAULT_REFRESH_TIME="${DEFAULT_REFRESH_TIME}"\
|
|
-o ${@} ${.TARGET:C/^bin/src/:C/.o$/.c/}
|
|
|
|
clean:
|
|
rm -rf bin/
|
|
|
|
.SUFFIXES: .c .o
|
|
.PHONY: clean
|