Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 101 lines (71 sloc) 3.408 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
16 DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG -Werror -O0
17 RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3 -DNDEBUG
18
19 DEBUG_LDFLAGS := -g
20
21 # Change for DEBUG or RELEASE
22 CFLAGS := -c $(DEBUG_CFLAGS)
23 LDFLAGS := $(DEBUG_LDFLAGS)
24
adbdb4a remove all absolute library path dependencies from Makefile & create_…
Elias Karakoulakis authored
25 # change directories if needed
8603286 Initial repo set-up
Elias Karakoulakis authored
26 OPENZWAVE := ../open-zwave
adbdb4a remove all absolute library path dependencies from Makefile & create_…
Elias Karakoulakis authored
27 THRIFT := /usr/local/include/thrift
6dae0a3 move SMC to /opt/smc, fix Makefile
Elias Karakoulakis authored
28 SMC := /opt/smc
8603286 Initial repo set-up
Elias Karakoulakis authored
29
30 INCLUDES := -I $(OPENZWAVE)/cpp/src -I $(OPENZWAVE)/cpp/src/command_classes/ \
31 -I $(OPENZWAVE)/cpp/src/value_classes/ -I $(OPENZWAVE)/cpp/src/platform/ \
32 -I $(OPENZWAVE)/cpp/src/platform/unix -I $(OPENZWAVE)/cpp/tinyxml/ \
adbdb4a remove all absolute library path dependencies from Makefile & create_…
Elias Karakoulakis authored
33 -I $(THRIFT) -I $(SMC)/lib/C++/ \
8603286 Initial repo set-up
Elias Karakoulakis authored
34 -I . -I gen-cpp/
35
36 # Remove comment below for gnutls support
37 GNUTLS := -lgnutls
38
39 # for Linux uncomment out next two lines
40 LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/linux/*.a)
41 LIBUSB := -ludev
8bb9da5 use boost::program_options to parse arguments to main()
Elias Karakoulakis authored
42 LIBPOCO := -lPocoNet -lboost_thread -lboost_program_options
8603286 Initial repo set-up
Elias Karakoulakis authored
43 LIBTHRIFT := -lthrift
44
45 # for Mac OS X comment out above 2 lines and uncomment next 2 lines
46 #LIBZWAVE := $(wildcard $(OPENZWAVE)/cpp/lib/mac/*.a)
47 #LIBUSB := -framework IOKit -framework CoreFoundation
48
8bb9da5 use boost::program_options to parse arguments to main()
Elias Karakoulakis authored
49 LIBS := $(LIBZWAVE) $(GNUTLS) $(LIBTHRIFT) $(LIBUSB) $(LIBPOCO)
8603286 Initial repo set-up
Elias Karakoulakis authored
50
51 %.o : %.cpp
52 $(CXX) $(CFLAGS) $(INCLUDES) -o $@ $<
53
54 %.o : %.c
55 $(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
56
57 all: main
58
34c2ebe More OpenZWave compatibility fixes
Elias Karakoulakis authored
59 gen-cpp/RemoteManager_server.cpp: create_server.rb gen-cpp/RemoteManager.cpp
adbdb4a remove all absolute library path dependencies from Makefile & create_…
Elias Karakoulakis authored
60 ruby1.9.1 create_server.rb --ozwroot=${OPENZWAVE} --thriftroot=$(THRIFT)
1ab4c95 add patch application to Makefile for ozw_types.h and RemoteManager_s…
Elias Karakoulakis authored
61 patch -p0 gen-cpp/RemoteManager_server.cpp < gen-cpp/RemoteManager_server.cpp.patch
2fc2a21 Makefiles are soooo 80's!
Elias Karakoulakis authored
62 patch -p0 gen-cpp/ozw_types.h <gen-cpp/ozw_types.h.patch
1ab4c95 add patch application to Makefile for ozw_types.h and RemoteManager_s…
Elias Karakoulakis authored
63
4951e1d create_server.rb: refactored code
Elias Karakoulakis authored
64 gen-cpp/RemoteManager.cpp: ozw.thrift
adbdb4a remove all absolute library path dependencies from Makefile & create_…
Elias Karakoulakis authored
65 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
66
67 gen-cpp/RemoteManager.o: gen-cpp/RemoteManager.cpp
a41ce7d 1) fix Makefile to produce binaries in their directories
Elias Karakoulakis authored
68 g++ $(CFLAGS) -c gen-cpp/RemoteManager.cpp -o gen-cpp/RemoteManager.o $(INCLUDES)
8603286 Initial repo set-up
Elias Karakoulakis authored
69
70 gen-cpp/ozw_constants.o: gen-cpp/ozw_constants.cpp
a41ce7d 1) fix Makefile to produce binaries in their directories
Elias Karakoulakis authored
71 g++ $(CFLAGS) -c gen-cpp/ozw_constants.cpp -o gen-cpp/ozw_constants.o $(INCLUDES)
8603286 Initial repo set-up
Elias Karakoulakis authored
72
1ab4c95 add patch application to Makefile for ozw_types.h and RemoteManager_s…
Elias Karakoulakis authored
73 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
74 g++ $(CFLAGS) -c gen-cpp/ozw_types.cpp -o gen-cpp/ozw_types.o $(INCLUDES)
8603286 Initial repo set-up
Elias Karakoulakis authored
75
76 Stomp_sm.cpp: Stomp.sm
77 smc -c++ Stomp.sm
78
79 Stomp_sm.o: Stomp_sm.cpp
80 g++ $(CFLAGS) -c Stomp_sm.cpp $(INCLUDES)
81
82 StompSocket.o: StompSocket.cpp StompSocket.h
83 g++ $(CFLAGS) -c StompSocket.cpp $(INCLUDES)
84
be7923d Added LGPL licence headers
Elias Karakoulakis authored
85 PocoStomp.o: PocoStomp.cpp PocoStomp.h Stomp_sm.cpp StompSocket.o
8603286 Initial repo set-up
Elias Karakoulakis authored
86 g++ $(CFLAGS) -c PocoStomp.cpp $(INCLUDES)
87
88 Main.o: Main.cpp Stomp_sm.o gen-cpp/RemoteManager_server.cpp
89 g++ $(CFLAGS) -c Main.cpp $(INCLUDES)
90
91 main: Main.o Stomp_sm.o StompSocket.o PocoStomp.o gen-cpp/RemoteManager.o gen-cpp/ozw_constants.o gen-cpp/ozw_types.o
92 $(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)
93
94 dist: main
95 rm -f Ansible_OpenZWave.tar.gz
34c2ebe More OpenZWave compatibility fixes
Elias Karakoulakis authored
96 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
97
98 clean:
adbdb4a remove all absolute library path dependencies from Makefile & create_…
Elias Karakoulakis authored
99 rm -f main *.o Stomp_sm.* gen-cpp/RemoteManager.cpp gen-cpp/RemoteManager_server.cpp gen-cpp/ozw_types.h
d9316be fixed subtle bug (ozw_types.h being double-patched after remake)
Elias Karakoulakis authored
100
Something went wrong with that request. Please try again.