Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 101 lines (71 sloc) 3.389 kb
8603286 Initial repo set-up
Elias Karakoulakis authored
1 #
34c2ebe More OpenZWave compatibility fixes
Elias Karakoulakis authored
2 # Makefile for Thrift4OZW
3 # Elias Karakoulakis <elias.karakoulakis@gmail.com>
4 # based on Makefile for OpenWave Control Panel application by Greg Satz
8603286 Initial repo set-up
Elias Karakoulakis authored
5
6 # GNU make only
7
8 .SUFFIXES: .cpp .o .a .s .thrift
9
10 CC := gcc
11 CXX := g++
12 LD := g++
13 AR := ar rc
14 RANLIB := ranlib
15 THRIFT := thrift
16
17 DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG -Werror -O0
18 RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3 -DNDEBUG
19
20 DEBUG_LDFLAGS := -g
21
22 # Change for DEBUG or RELEASE
23 CFLAGS := -c $(DEBUG_CFLAGS)
24 LDFLAGS := $(DEBUG_LDFLAGS)
25
26 OPENZWAVE := ../open-zwave
27 LIBTHRIFT := ../libmicrohttpd/src/daemon/.libs/libmicrohttpd.a
28
29 INCLUDES := -I $(OPENZWAVE)/cpp/src -I $(OPENZWAVE)/cpp/src/command_classes/ \
30 -I $(OPENZWAVE)/cpp/src/value_classes/ -I $(OPENZWAVE)/cpp/src/platform/ \
31 -I $(OPENZWAVE)/cpp/src/platform/unix -I $(OPENZWAVE)/cpp/tinyxml/ \
32 -I /usr/local/include/thrift -I /home/ekarak/smc_6_0_1/lib/C++/ \
33 -I . -I gen-cpp/
34
35 # Remove comment below for gnutls support
36 GNUTLS := -lgnutls
37
38 # for Linux uncomment out next two lines
39 LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/linux/*.a)
40 LIBUSB := -ludev
41 LIBPOCO := -lPocoNet -lboost_thread
42 LIBTHRIFT := -lthrift
43
44 # for Mac OS X comment out above 2 lines and uncomment next 2 lines
45 #LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/mac/*.a)
46 #LIBUSB := -framework IOKit -framework CoreFoundation
47
48 LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBMICROHTTPD) $(LIBTHRIFT) $(LIBUSB) $(LIBPOCO)
49
50 %.o : %.cpp
51 $(CXX) $(CFLAGS) $(INCLUDES) -o $@ $<
52
53 %.o : %.c
54 $(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
55
56 all: main
57
34c2ebe More OpenZWave compatibility fixes
Elias Karakoulakis authored
58 gen-cpp/RemoteManager_server.cpp: create_server.rb gen-cpp/RemoteManager.cpp
4951e1d create_server.rb: refactored code
Elias Karakoulakis authored
59 ruby1.9.1 create_server.rb
1ab4c95 add patch application to Makefile for ozw_types.h and RemoteManager_s…
Elias Karakoulakis authored
60 patch -p0 gen-cpp/RemoteManager_server.cpp < gen-cpp/RemoteManager_server.cpp.patch
61
4951e1d create_server.rb: refactored code
Elias Karakoulakis authored
62 gen-cpp/RemoteManager.cpp: ozw.thrift
b2c0dd0 create all target languages by default
Elias Karakoulakis authored
63 $(THRIFT) --gen cocoa --gen cpp --gen csharp --gen erl --gen go --gen java --gen js --gen perl --gen php --gen py --gen rb ozw.thrift
8603286 Initial repo set-up
Elias Karakoulakis authored
64
65 gen-cpp/RemoteManager.o: gen-cpp/RemoteManager.cpp
a41ce7d 1) fix Makefile to produce binaries in their directories
Elias Karakoulakis authored
66 g++ $(CFLAGS) -c gen-cpp/RemoteManager.cpp -o gen-cpp/RemoteManager.o $(INCLUDES)
8603286 Initial repo set-up
Elias Karakoulakis authored
67
68 gen-cpp/ozw_constants.o: gen-cpp/ozw_constants.cpp
a41ce7d 1) fix Makefile to produce binaries in their directories
Elias Karakoulakis authored
69 g++ $(CFLAGS) -c gen-cpp/ozw_constants.cpp -o gen-cpp/ozw_constants.o $(INCLUDES)
8603286 Initial repo set-up
Elias Karakoulakis authored
70
1ab4c95 add patch application to Makefile for ozw_types.h and RemoteManager_s…
Elias Karakoulakis authored
71 gen-cpp/ozw_types.o: gen-cpp/ozw_types.cpp gen-cpp/ozw_types.h
a41ce7d 1) fix Makefile to produce binaries in their directories
Elias Karakoulakis authored
72 g++ $(CFLAGS) -c gen-cpp/ozw_types.cpp -o gen-cpp/ozw_types.o $(INCLUDES)
1ab4c95 add patch application to Makefile for ozw_types.h and RemoteManager_s…
Elias Karakoulakis authored
73
74 gen-cpp/ozw_types.h: gen-cpp/ozw_types.h.patch
75 patch -p0 gen-cpp/ozw_types.h <gen-cpp/ozw_types.h.patch
8603286 Initial repo set-up
Elias Karakoulakis authored
76
77 Stomp_sm.cpp: Stomp.sm
78 smc -c++ Stomp.sm
79
80 Stomp_sm.o: Stomp_sm.cpp
81 g++ $(CFLAGS) -c Stomp_sm.cpp $(INCLUDES)
82
83 StompSocket.o: StompSocket.cpp StompSocket.h
84 g++ $(CFLAGS) -c StompSocket.cpp $(INCLUDES)
85
be7923d Added LGPL licence headers
Elias Karakoulakis authored
86 PocoStomp.o: PocoStomp.cpp PocoStomp.h Stomp_sm.cpp StompSocket.o
8603286 Initial repo set-up
Elias Karakoulakis authored
87 g++ $(CFLAGS) -c PocoStomp.cpp $(INCLUDES)
88
89 Main.o: Main.cpp Stomp_sm.o gen-cpp/RemoteManager_server.cpp
90 g++ $(CFLAGS) -c Main.cpp $(INCLUDES)
91
92 main: Main.o Stomp_sm.o StompSocket.o PocoStomp.o gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o
93 $(LD) -o $@ $(LDFLAGS) Main.o Stomp_sm.o StompSocket.o PocoStomp.o gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o $(LIBS)
94
95 dist: main
96 rm -f Ansible_OpenZWave.tar.gz
34c2ebe More OpenZWave compatibility fixes
Elias Karakoulakis authored
97 tar -c --exclude=".git" --exclude ".svn" -hvzf Ansible_OpenZWave.tar.gz ozwcp config/ cp.html cp.js openzwavetinyicon.png README
8603286 Initial repo set-up
Elias Karakoulakis authored
98
99 clean:
1ab4c95 add patch application to Makefile for ozw_types.h and RemoteManager_s…
Elias Karakoulakis authored
100 rm -f main *.o Stomp_sm.* gen-cpp/RemoteManager_server.cpp
Something went wrong with that request. Please try again.