lib/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
parent 20
f7f9463cdefd
child 32
3bac8fd4173d
permissions
-rw-r--r--

Added library code to read DHT11 temperature/humidity sensor

# Makefile for the library files.

include ../Makefile.global

SRCS		= xutil.c rdconfig.c lcd-pcf8574.c rc-switch.c dht11.c
OBJS		= xutil.o rdconfig.o lcd-pcf8574.o rc-switch.o dht11.o
HDRS		= mbselib.h
TARGET		= libmbse.a

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

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

all:		${TARGET}

libmbse.a:	${OBJS}
		ar r $@ $?
		${RANLIB} $@

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

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
xutil.o: ../config.h mbselib.h
rdconfig.o: ../config.h mbselib.h
lcd-pcf8574.o: ../config.h mbselib.h
rc-switch.o: ../config.h mbselib.h
dht11.o: ../config.h mbselib.h
# End of generated dependencies

mercurial