bmsd/Makefile

Sat, 04 Aug 2018 21:19:15 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 04 Aug 2018 21:19:15 +0200
changeset 0
033898178630
child 5
36387e45a194
permissions
-rw-r--r--

Versio 0.0.2 initial check in

0
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 # Makefile for the mbsePi-apps/thermferm.
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 include ../Makefile.global
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 SRCS = $(wildcard *.c)
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 HDRS = $(wildcard *.h)
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 OBJS = $(SRCS:.c=.o)
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 SLIBS = -lpthread
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 TARGET = bmsd
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 OTHER = Makefile
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 #############################################################################
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 .c.o:
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 ${CC} ${CFLAGS} ${INCLUDES} ${DEFINES} -c $<
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 all: ${TARGET}
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 bmsd: ${OBJS} ${SLIBS}
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 ${CC} -o bmsd ${OBJS} ${LDFLAGS} ${LIBS} ${SLIBS}
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 clean:
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 rm -f ${TARGET} *.o *.h~ *.c~ core filelist Makefile.bak
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 install: all
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 ${INSTALL} -c -s -g root -o root -m 0755 bmsd ${BINDIR}
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 filelist: Makefile
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 BASE=`pwd`; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 BASE=`basename $${BASE}`; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 (for f in ${SRCS} ${HDRS} ${OTHER} ;do echo ${PACKAGE}-${VERSION}/$${BASE}/$$f; done) >filelist
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 depend:
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 @rm -f Makefile.bak; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 mv Makefile Makefile.bak; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 sed -e '/^# DO NOT DELETE/,$$d' Makefile.bak >Makefile; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 ${ECHO} '# DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT' \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 >>Makefile; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 ${ECHO} '# Dependencies generated by make depend' >>Makefile; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 for f in ${SRCS}; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 do \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 ${ECHO} "Dependencies for $$f:\c"; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 ${ECHO} "`basename $$f .c`.o:\c" >>Makefile; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 for h in `sed -n -e \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 's/^#[ ]*include[ ]*"\([^"]*\)".*/\1/p' $$f`; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 do \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 ${ECHO} " $$h\c"; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 ${ECHO} " $$h\c" >>Makefile; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 done; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 ${ECHO} " done."; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 ${ECHO} "" >>Makefile; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 done; \
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 ${ECHO} '# End of generated dependencies' >>Makefile
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 # Dependencies generated by make depend
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 mqtt.o: bms.h xutil.h mqtt.h nodes.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 nodes.o: bms.h xutil.h nodes.h mysql.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 futil.o: bms.h futil.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 lock.o: lock.h bms.h futil.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 bms.o: bms.h xutil.h rdconfig.h lock.h mqtt.h mysql.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 xutil.o: bms.h xutil.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 rdconfig.o: bms.h xutil.h futil.h rdconfig.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 mysql.o: bms.h xutil.h mysql.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 # End of generated dependencies

mercurial