summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 84dda379aea97892fdfb2fc2ad0a58c75c4ece57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#
# OpenWFD - Open-Source Wifi-Display Implementation
# Copyright (c) 2013 David Herrmann <dh.herrmann@gmail.com>
#

#
# Global Configurations and Initializations
#

ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
AUTOMAKE_OPTIONS = color-tests
.DELETE_ON_ERROR:

include_HEADERS =
EXTRA_DIST = \
	README \
	COPYING \
	NEWS
CLEANFILES =
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
TPHONY =

TESTS =
bin_PROGRAMS =
check_PROGRAMS =
lib_LTLIBRARIES =
noinst_LTLIBRARIES =

#
# Default CFlags
# Make all files include "config.h" by default. This shouldn't cause any
# problems and we cannot forget to include it anymore.
#
# Also make the linker discard all unused symbols.
#

AM_CFLAGS = \
	-Wall \
	-pipe \
	-fno-common \
	-ffast-math \
	-fdiagnostics-show-option \
	-fno-strict-aliasing \
	-fvisibility=hidden \
	-ffunction-sections \
	-fdata-sections
AM_CPPFLAGS = \
	-include $(top_builddir)/config.h \
	-I $(srcdir)/src
AM_LDFLAGS = \
	-Wl,--as-needed \
	-Wl,--gc-sections \
	-Wl,-z,relro \
	-Wl,-z,now

#
# Additional parameters
# TODO: these should be configurable in configure.ac
#

AM_CPPFLAGS += \
	-DBUILD_ENABLE_DEBUG \
	"-DBUILD_BINDIR_WPA_SUPPLICANT=\"/bin\"" \
	"-DBUILD_BINDIR_IP=\"/bin\""

#
# SHL - Static Helper Library
# The SHL subsystem contains several small code pieces used all over the place.
#

noinst_LTLIBRARIES += libshl.la

libshl_la_SOURCES = \
	src/shl_dlist.h \
	src/shl_llog.h \
	src/shl_log.h \
	src/shl_log.c \
	src/shl_ring.h \
	src/shl_ring.c
libshl_la_CPPFLAGS = $(AM_CPPFLAGS)
libshl_la_LDFLAGS = $(AM_LDFLAGS)
libshl_la_LIBADD = $(AM_LIBADD)

#
# gdhcp - dhcp implementation
#

noinst_LTLIBRARIES += libgdhcp.la

libgdhcp_la_SOURCES = \
	src/gdhcp/gdhcp.h \
	src/gdhcp/unaligned.h \
	src/gdhcp/common.h \
	src/gdhcp/common.c \
	src/gdhcp/ipv4ll.h \
	src/gdhcp/ipv4ll.c \
	src/gdhcp/client.c \
	src/gdhcp/server.c
libgdhcp_la_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	$(GDHCP_CFLAGS)
libgdhcp_la_LDFLAGS = $(AM_LDFLAGS)
libgdhcp_la_LIBADD = \
	$(AM_LIBADD) \
	$(GDHCP_LIBS)

#
# owfd - shared helpers
#

noinst_LTLIBRARIES += libowfd.la

libowfd_la_SOURCES = \
	src/rtsp.h \
	src/rtsp_ctrl.c \
	src/rtsp_decoder.c \
	src/rtsp_tokenizer.c \
	src/shared.h \
	src/shared.c \
	src/wpa.h \
	src/wpa_ctrl.c \
	src/wpa_parser.c
libowfd_la_CPPFLAGS = $(AM_CPPFLAGS)
libowfd_la_LDFLAGS = $(AM_LDFLAGS)
libowfd_la_LIBADD = $(AM_LIBADD)

#
# openwfd_p2pd
#

bin_PROGRAMS += openwfd_p2pd

openwfd_p2pd_SOURCES = \
	src/p2pd.h \
	src/p2pd.c \
	src/p2pd_config.c \
	src/p2pd_dummy.c \
	src/p2pd_interface.c

openwfd_p2pd_CPPFLAGS = $(AM_CPPFLAGS)
openwfd_p2pd_LDADD = \
	libowfd.la \
	libshl.la
openwfd_p2pd_LDFLAGS = $(AM_LDFLAGS)

#
# openwfd_dhcp
#

bin_PROGRAMS += openwfd_dhcp

openwfd_dhcp_SOURCES = \
	src/dhcp.h \
	src/dhcp.c \
	src/dhcp_config.c

openwfd_dhcp_CPPFLAGS = \
	$(AM_CPPFLAGS) \
	$(DHCP_CFLAGS)
openwfd_dhcp_LDADD = \
	$(DHCP_LIBS) \
	libgdhcp.la \
	libowfd.la \
	libshl.la
openwfd_dhcp_LDFLAGS = $(AM_LDFLAGS)

#
# Tools
#

check_PROGRAMS += \
	openwfd_ie

openwfd_ie_SOURCES = tools/openwfd_ie.c
openwfd_ie_CPPFLAGS = $(AM_CPPFLAGS)
openwfd_ie_LDADD =
openwfd_ie_LDFLAGS = $(AM_LDFLAGS)

#
# Tests
#

tests = \
	test_rtsp \
	test_wpa

if BUILD_HAVE_CHECK
check_PROGRAMS += $(tests)
TESTS += $(tests)
endif

test_sources = \
	test/test_common.h
test_libs = \
	libowfd.la \
	libshl.la \
	$(CHECK_LIBS)
test_cflags = \
	$(AM_CPPFLAGS) \
	$(CHECK_CFLAGS)
test_lflags = \
	$(AM_LDFLAGS)

test_rtsp_SOURCES = test/test_rtsp.c $(test_sources)
test_rtsp_CPPFLAGS = $(test_cflags)
test_rtsp_LDADD = $(test_libs)
test_rtsp_LDFLAGS = $(test_lflags)

test_wpa_SOURCES = test/test_wpa.c $(test_sources)
test_wpa_CPPFLAGS = $(test_cflags)
test_wpa_LDADD = $(test_libs)
test_wpa_LDFLAGS = $(test_lflags)

#
# Phony targets
#

.PHONY: $(TPHONY)

#
# Empty .SECONDARY target causes alle intermediate files to be treated as
# secondary files. That is, they don't get deleted after make finished.
#

.SECONDARY: