dht11/Makefile

Thu, 08 May 2014 22:36:51 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 08 May 2014 22:36:51 +0200
changeset 31
89dd2b691701
child 51
a03b6dac5398
permissions
-rw-r--r--

Added library code to read DHT11 temperature/humidity sensor

# Makefile for the mbsePi-apps/thermometers.

include ../Makefile.global

SRCS		= dht11.c
HDRS		= dht11.h
OBJS		= dht11.o
SLIBS		= ../lib/libmbse.a
TARGET		= dht11
OTHER		= Makefile

#############################################################################

.c.o:
		${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $<

all:		${TARGET}

dht11:		dht11.o ${SLIBS}
		${CC} -o dht11 dht11.o ${LDFLAGS} ${LIBS} ${SLIBS}

clean:
		rm -f ${TARGET} *.o *.h~ *.c~ core filelist Makefile.bak

install:	all
		${INSTALL} -c -s -g root -o root -m 0755 ${TARGET} ${BINDIR}

filelist:	Makefile
		BASE=`pwd`; \
		BASE=`basename $${BASE}`; \
		(for f in ${SRCS} ${HDRS} ${OTHER} ;do echo ${PACKAGE}-${VERSION}/$${BASE}/$$f; done) >filelist

depend:
	@rm -f Makefile.bak; \
	mv Makefile Makefile.bak; \
	sed -e '/^# DO NOT DELETE/,$$d' Makefile.bak >Makefile; \
	${ECHO} '# DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT' \
		>>Makefile; \
	${ECHO} '# Dependencies generated by make depend' >>Makefile; \
	for f in ${SRCS}; \
	do \
		${ECHO} "Dependencies for $$f:\c"; \
		${ECHO} "`basename $$f .c`.o:\c" >>Makefile; \
		for h in `sed -n -e \
			's/^#[ 	]*include[ 	]*"\([^"]*\)".*/\1/p' $$f`; \
		do \
			${ECHO} " $$h\c"; \
			${ECHO} " $$h\c" >>Makefile; \
		done; \
		${ECHO} " done."; \
		${ECHO} "" >>Makefile; \
	done; \
	${ECHO} '# End of generated dependencies' >>Makefile

# DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT
# Dependencies generated by make depend
dht11.o: ../lib/mbselib.h dht11.h
# End of generated dependencies

mercurial