Sat, 17 May 2014 10:41:49 +0200
Simplified Makefile
0 | 1 | dnl Process this file with autoconf to produce a configure script. |
2 | ||
3 | AC_INIT(thermometers/main.c) | |
4 | AM_CONFIG_HEADER(config.h) | |
31
89dd2b691701
Added library code to read DHT11 temperature/humidity sensor
Michiel Broek <mbroek@mbse.eu>
parents:
26
diff
changeset
|
5 | SUBDIRS="lib coolers dht11 rc433 thermometers" |
0 | 6 | AC_SUBST(SUBDIRS) |
7 | ||
8 | dnl General settings | |
9 | dnl After changeing the version number, run autoconf! | |
10 | PACKAGE="mbsePi-apps" | |
31
89dd2b691701
Added library code to read DHT11 temperature/humidity sensor
Michiel Broek <mbroek@mbse.eu>
parents:
26
diff
changeset
|
11 | VERSION="0.0.5" |
0 | 12 | COPYRIGHT="Copyright (C) 2014 Michiel Broek, All Rights Reserved" |
13 | CYEARS="2014" | |
14 | AC_SUBST(PACKAGE) | |
15 | AC_SUBST(VERSION) | |
16 | AC_SUBST(COPYRIGHT) | |
17 | AC_SUBST(CYEARS) | |
18 | AC_PREFIX_DEFAULT(/usr/local) | |
19 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") | |
20 | AC_DEFINE_UNQUOTED(COPYRIGHT, "$COPYRIGHT") | |
21 | TARGET="$target" | |
22 | ||
23 | ||
24 | dnl Checks for programs. | |
25 | AC_PROG_CC | |
26 | AC_PROG_RANLIB | |
27 | dnl Try to find GNU install | |
28 | AC_CHECK_PROG(INSTALL, ginstall, ginstall) | |
29 | AC_CHECK_PROG(INSTALL, install, install) | |
30 | AC_CHECK_PROG(TAR, tar, tar) | |
31 | ||
32 | # | |
6 | 33 | # Libraries for mbsePi-apps |
34 | # | |
35 | AC_CHECK_LIB(mosquitto,mosquitto_lib_init,result=yes,result=no) | |
36 | if test "$result" = "yes"; then | |
37 | LIBS="$LIBS -lmosquitto" | |
38 | else | |
39 | AC_MSG_ERROR(libmosquitto not found) | |
40 | fi | |
41 | ||
17
b802305046dc
Tests for wiringPi are now not fatal
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
42 | |
b802305046dc
Tests for wiringPi are now not fatal
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
43 | WIRINGPI=No |
16
f4cbe008da72
Version 0.0.2. Added LCD display using wiringPi library. The display is connected via a LCM1602 IIC board.
Michiel Broek <mbroek@mbse.eu>
parents:
13
diff
changeset
|
44 | AC_CHECK_LIB(wiringPi,wiringPiSetup,result=yes,result=no) |
f4cbe008da72
Version 0.0.2. Added LCD display using wiringPi library. The display is connected via a LCM1602 IIC board.
Michiel Broek <mbroek@mbse.eu>
parents:
13
diff
changeset
|
45 | if test "$result" = "yes"; then |
f4cbe008da72
Version 0.0.2. Added LCD display using wiringPi library. The display is connected via a LCM1602 IIC board.
Michiel Broek <mbroek@mbse.eu>
parents:
13
diff
changeset
|
46 | LIBS="$LIBS -lwiringPi -lwiringPiDev" |
17
b802305046dc
Tests for wiringPi are now not fatal
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
47 | AC_CHECK_HEADERS(wiringPi.h,WIRINGPI=Yes,WIRINGPI=No) |
16
f4cbe008da72
Version 0.0.2. Added LCD display using wiringPi library. The display is connected via a LCM1602 IIC board.
Michiel Broek <mbroek@mbse.eu>
parents:
13
diff
changeset
|
48 | fi |
f4cbe008da72
Version 0.0.2. Added LCD display using wiringPi library. The display is connected via a LCM1602 IIC board.
Michiel Broek <mbroek@mbse.eu>
parents:
13
diff
changeset
|
49 | |
f4cbe008da72
Version 0.0.2. Added LCD display using wiringPi library. The display is connected via a LCM1602 IIC board.
Michiel Broek <mbroek@mbse.eu>
parents:
13
diff
changeset
|
50 | |
6 | 51 | # |
0 | 52 | # Additional commandline switches |
53 | # | |
54 | AC_ARG_ENABLE(experiment, [ --enable-experiment Compile experimental code], [ experiment=$enableval ], [ experiment=no ]) | |
55 | if test "$experiment" = "yes"; then | |
56 | AC_DEFINE(USE_EXPERIMENT) | |
57 | fi | |
58 | ||
59 | AC_ARG_ENABLE(debugging, [ --enable-debugging Compile for debugging], [ debugging=$enableval ], [ debugging=no ]) | |
60 | if test "$debugging" = "yes"; then | |
61 | CFLAGS="-O -g -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -Winline" | |
62 | else | |
63 | CFLAGS="-g -O2 -fomit-frame-pointer -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -Winline" | |
64 | fi | |
65 | ||
66 | dnl Checks for header files. | |
67 | AC_HEADER_STDC | |
68 | ||
69 | ||
70 | AC_SUBST(CXXFLAGS) | |
71 | ||
72 | AC_OUTPUT( | |
73 | Makefile.global | |
74 | ) | |
75 | ||
76 | AC_MSG_RESULT([ | |
77 | -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=- | |
78 | ||
79 | Configuration summary : | |
80 | ||
81 | Version : ............ ${VERSION} | |
82 | Main directory : ..... ${prefix} | |
17
b802305046dc
Tests for wiringPi are now not fatal
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
83 | WiringPi : ........... ${WIRINGPI} |
0 | 84 | |
85 | Now type 'make' and 'sudo make install' | |
86 | ]) | |
87 |