6b13f685e
김민수
BSP 최초 추가
|
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
|
From a6f312dfb4497d5e72664c4772a8b122e25b81d8 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fabrice.fontaine@orange.com>
Date: Tue, 26 Jul 2016 09:09:53 +0200
Subject: [PATCH] Update Makefile.in to allow cross-compilation
Use CC, CPP and DESTDIR environment variables passed to configure in Makefile.in files
Fix definition of LIBS and LDFLAGS (LDFLAGS was set to @LIBS@)
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
---
Makefile.in | 13 ++++++++-----
aes/Makefile.in | 7 +++++--
doc/Makefile.in | 4 ++--
ecc/Makefile.in | 7 +++++--
sha2/Makefile.in | 7 +++++--
tests/Makefile.in | 4 +++-
6 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 38cc665..7dcd424 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -40,7 +40,9 @@ OBJECTS:= $(patsubst %.c, %.o, $(SOURCES)) $(SUB_OBJECTS)
HEADERS:=dtls.h hmac.h dtls_debug.h dtls_config.h uthash.h numeric.h crypto.h global.h ccm.h \
netq.h alert.h utlist.h prng.h peer.h state.h dtls_time.h session.h \
tinydtls.h
+CC:=@CC@
CFLAGS:=-Wall -pedantic -std=c99 @CFLAGS@
+CPP:=@CPP@
CPPFLAGS:=@CPPFLAGS@ -DDTLS_CHECK_CONTENTTYPE
SUBDIRS:=tests doc platform-specific sha2 aes ecc
DISTSUBDIRS:=$(SUBDIRS)
@@ -48,7 +50,8 @@ DISTDIR=$(top_builddir)/$(package)
FILES:=Makefile.in configure configure.in dtls_config.h.in tinydtls.h.in \
Makefile.tinydtls $(SOURCES) $(HEADERS)
LIB:=libtinydtls.a
-LDFLAGS:=@LIBS@
+LDFLAGS:=@LDFLAGS@
+LIBS:=@LIBS@
ARFLAGS:=cru
doc:=doc
@@ -100,10 +103,10 @@ dist: $(FILES) $(DISTSUBDIRS)
tar czf $(package).tar.gz $(DISTDIR)
install: $(LIB) $(HEADERS) $(SUBDIRS)
- test -d $(libdir) || mkdir -p $(libdir)
- test -d $(includedir) || mkdir -p $(includedir)
- $(install) $(LIB) $(libdir)/
- $(install) $(HEADERS) $(includedir)/
+ test -d $(DESTDIR)$(libdir) || mkdir -p $(DESTDIR)$(libdir)
+ test -d $(DESTDIR)$(includedir) || mkdir -p $(DESTDIR)$(includedir)
+ $(install) $(LIB) $(DESTDIR)$(libdir)/
+ $(install) $(HEADERS) $(DESTDIR)$(includedir)/
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir install="$(install)" includedir=$(includedir) install; \
done
diff --git a/aes/Makefile.in b/aes/Makefile.in
index 7c9f6ef..9ff7799 100644
--- a/aes/Makefile.in
+++ b/aes/Makefile.in
@@ -28,8 +28,11 @@ top_srcdir:= @top_srcdir@
SOURCES:= rijndael.c
HEADERS:= rijndael.h
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
+CPP=@CPP@
CPPFLAGS=@CPPFLAGS@
+CC=@CC@
CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@
+LDFLAGS=@LDFLAGS@
LDLIBS=@LIBS@
FILES:=Makefile.in $(SOURCES) $(HEADERS)
DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
@@ -60,8 +63,8 @@ dist: $(FILES)
cp -p $(FILES) $(DISTDIR)/aes
install: $(HEADERS)
- test -d $(includedir)/aes || mkdir -p $(includedir)/aes
- $(install) $(HEADERS) $(includedir)/aes
+ test -d $(DESTDIR)$(includedir)/aes || mkdir -p $(DESTDIR)$(includedir)/aes
+ $(install) $(HEADERS) $(DESTDIR)$(includedir)/aes
.gitignore:
echo "core
*~
*.[oa]
*.gz
*.cap
$(PROGRAM)
$(DISTDIR)
.gitignore" >$@
diff --git a/doc/Makefile.in b/doc/Makefile.in
index a07101e..5ab0a35 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -32,5 +32,5 @@ dist: doc
cp -r $(FILES) $(DISTDIR)/doc
install: $(doc) html
- test -d $(htmldir) || mkdir -p $(htmldir)
- cp -r html/* $(htmldir)
+ test -d $(DESTDIR)$(htmldir) || mkdir -p $(DESTDIR)$(htmldir)
+ cp -r html/* $(DESTDIR)$(htmldir)
diff --git a/ecc/Makefile.in b/ecc/Makefile.in
index 2ba17a1..2086d4f 100644
--- a/ecc/Makefile.in
+++ b/ecc/Makefile.in
@@ -36,8 +36,11 @@ include Makefile.contiki
else
ECC_OBJECTS:= $(patsubst %.c, %.o, $(ECC_SOURCES)) ecc_test.o
PROGRAMS:= testecc testfield
+CPP=@CPP@
CPPFLAGS=@CPPFLAGS@
+CC=@CC@
CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ -DTEST_INCLUDE
+LDFLAGS=@LDFLAGS@
LDLIBS=@LIBS@
.PHONY: all dirs clean install distclean .gitignore doc
@@ -74,8 +77,8 @@ dist: $(FILES)
cp -p $(FILES) $(DISTDIR)/ecc
install: $(HEADERS)
- test -d $(includedir)/ecc || mkdir -p $(includedir)/ecc
- $(install) $(HEADERS) $(includedir)/ecc
+ test -d $(DESTDIR)$(includedir)/ecc || mkdir -p $(DESTDIR)$(includedir)/ecc
+ $(install) $(ECC_HEADERS) $(DESTDIR)$(includedir)/ecc
.gitignore:
echo "core
*~
*.[oa]
*.gz
*.cap
$(PROGRAM)
$(DISTDIR)
.gitignore" >$@
diff --git a/sha2/Makefile.in b/sha2/Makefile.in
index 9f19314..69f8793 100644
--- a/sha2/Makefile.in
+++ b/sha2/Makefile.in
@@ -28,8 +28,11 @@ top_srcdir:= @top_srcdir@
SOURCES:= sha2.c
HEADERS:=sha2.h
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
+CPP=@CPP@
CPPFLAGS=@CPPFLAGS@ -I$(top_srcdir)
+CC=@CC@
CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@
+LDFLAGS=@LDFLAGS@
LDLIBS=@LIBS@
FILES:=Makefile.in $(SOURCES) $(HEADERS) README sha2prog.c sha2speed.c sha2test.pl
DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
@@ -62,8 +65,8 @@ dist: $(FILES)
cp -pr testvectors $(DISTDIR)/sha2/testvectors
install: $(HEADERS)
- test -d $(includedir)/sha2 || mkdir -p $(includedir)/sha2
- $(install) $(HEADERS) $(includedir)/sha2
+ test -d $(DESTDIR)$(includedir)/sha2 || mkdir -p $(DESTDIR)$(includedir)/sha2
+ $(install) $(HEADERS) $(DESTDIR)$(includedir)/sha2
.gitignore:
echo "core
*~
*.[oa]
*.gz
*.cap
$(PROGRAM)
$(DISTDIR)
.gitignore" >$@
diff --git a/tests/Makefile.in b/tests/Makefile.in
index a8a2ed0..b45f440 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -32,9 +32,11 @@ SOURCES:= dtls-server.c ccm-test.c prf-test.c \
OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
PROGRAMS:= $(patsubst %.c, %, $(SOURCES))
HEADERS:=
+CC:=@CC@
CFLAGS:=-Wall @CFLAGS@
+CPP:=@CPP@
CPPFLAGS:=-I$(top_srcdir) @CPPFLAGS@
-LDFLAGS:=-L$(top_builddir)
+LDFLAGS:=-L$(top_builddir) @LDFLAGS@
LDLIBS:=-ltinydtls @LIBS@
DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
FILES:=Makefile.in $(SOURCES) ccm-testdata.c #cbc_aes128-testdata.c
--
2.7.4
|