* [crda PATCH 1/5] Fix building with --as-needed LD flag.
2008-12-01 10:30 [crda PATCH 0/5] Makefile improvement and fixes Diego 'Flameeyes' Pettenò
@ 2008-12-01 10:30 ` Diego 'Flameeyes' Pettenò
2008-12-01 10:30 ` [crda PATCH 2/5] Fix dependencies for parallel make and others Diego 'Flameeyes' Pettenò
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2008-12-01 10:30 UTC (permalink / raw)
To: linux-wireless
=46rom: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
When using GNU ld --as-needed option, you need to ensure that the
order of parameters to the linker is formally correct, with libraries
coming after the object files. For this reason, don't use LDFLAGS for
passing the libraries, and make sure that LDLIBS goes at the end of
the line.
Signed-off-by: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
---
Makefile | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 91c4329..25a92fe 100644
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,9 @@ PUBKEY_DIR=3Dpubkeys
=20
CFLAGS +=3D -Wall -g
#CFLAGS +=3D -DUSE_OPENSSL `pkg-config --cflags openssl`
-#LDFLAGS +=3D `pkg-config --libs openssl`
+#LDLIBS +=3D `pkg-config --libs openssl`
CFLAGS +=3D -DUSE_GCRYPT
-LDFLAGS +=3D -lgcrypt
+LDLIBS +=3D -lgcrypt
=20
MKDIR ?=3D mkdir -p
INSTALL ?=3D install
@@ -35,15 +35,15 @@ keys-%.c: utils/key2pub.py $(PUBKEY_DIR)/$(wildcard=
*.pem)
=20
crda: keys-ssl.c keys-gcrypt.c reglib.o crda.o
$(NQ) ' LD ' $@
- $(Q)$(CC) $(CFLAGS) $(LDFLAGS) `pkg-config --libs libnl-1` -o $@ regl=
ib.o crda.o
+ $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o crda.o `pkg-config --li=
bs libnl-1` $(LDLIBS)
=20
regdbdump: keys-ssl.c keys-gcrypt.c reglib.o regdbdump.o
$(NQ) ' LD ' $@
- $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o regdbdump.o
+ $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o regdbdump.o $(LDLIBS)
=20
intersect: keys-ssl.c keys-gcrypt.c reglib.o intersect.o
$(NQ) ' LD ' $@
- $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o intersect.o
+ $(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o intersect.o $(LDLIBS)
=20
verify: $(REG_BIN) regdbdump
$(NQ) ' CHK $(REG_BIN)'
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* [crda PATCH 2/5] Fix dependencies for parallel make and others.
2008-12-01 10:30 [crda PATCH 0/5] Makefile improvement and fixes Diego 'Flameeyes' Pettenò
2008-12-01 10:30 ` [crda PATCH 1/5] Fix building with --as-needed LD flag Diego 'Flameeyes' Pettenò
@ 2008-12-01 10:30 ` Diego 'Flameeyes' Pettenò
2008-12-01 10:31 ` [crda PATCH 3/5] Make it possible to switch gcrypt/openssl via knob Diego 'Flameeyes' Pettenò
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2008-12-01 10:30 UTC (permalink / raw)
To: linux-wireless
=46rom: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
Since the keys .c files are included by reglib.c, it's not the final
output to depend on them but rather reglib.o.
This not only fixes proper regeneration of reglib.o when the pem files
are changed, but also allows proper parallel make of the package.
Signed-off-by: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
---
Makefile | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 25a92fe..ec06534 100644
--- a/Makefile
+++ b/Makefile
@@ -33,15 +33,17 @@ keys-%.c: utils/key2pub.py $(PUBKEY_DIR)/$(wildcard=
*.pem)
$(NQ) ' CC ' $@
$(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
=20
-crda: keys-ssl.c keys-gcrypt.c reglib.o crda.o
+reglib.o: keys-ssl.c keys-gcrypt.c
+
+crda: reglib.o crda.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o crda.o `pkg-config --li=
bs libnl-1` $(LDLIBS)
=20
-regdbdump: keys-ssl.c keys-gcrypt.c reglib.o regdbdump.o
+regdbdump: reglib.o regdbdump.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o regdbdump.o $(LDLIBS)
=20
-intersect: keys-ssl.c keys-gcrypt.c reglib.o intersect.o
+intersect: reglib.o intersect.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o intersect.o $(LDLIBS)
=20
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* [crda PATCH 3/5] Make it possible to switch gcrypt/openssl via knob.
2008-12-01 10:30 [crda PATCH 0/5] Makefile improvement and fixes Diego 'Flameeyes' Pettenò
2008-12-01 10:30 ` [crda PATCH 1/5] Fix building with --as-needed LD flag Diego 'Flameeyes' Pettenò
2008-12-01 10:30 ` [crda PATCH 2/5] Fix dependencies for parallel make and others Diego 'Flameeyes' Pettenò
@ 2008-12-01 10:31 ` Diego 'Flameeyes' Pettenò
2008-12-01 10:31 ` [crda PATCH 4/5] Don't use recursive make for verify target Diego 'Flameeyes' Pettenò
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2008-12-01 10:31 UTC (permalink / raw)
To: linux-wireless
=46rom: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
By building with "make USE_OPENSSL=3D1", OpenSSL will be used in
libcrypt's stead. This also allows for properly depend just on the
keys-*.c source file that is actually going to be used.
Note that the all target is moved up so that it still hits as default
target.
Signed-off-by: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
---
Makefile | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index ec06534..4ac8495 100644
--- a/Makefile
+++ b/Makefile
@@ -6,11 +6,24 @@ REG_BIN?=3D/usr/lib/crda/regulatory.bin
PUBKEY_DIR=3Dpubkeys
=20
CFLAGS +=3D -Wall -g
-#CFLAGS +=3D -DUSE_OPENSSL `pkg-config --cflags openssl`
-#LDLIBS +=3D `pkg-config --libs openssl`
+
+all: crda intersect
+ $(Q)$(MAKE) --no-print-directory -f Makefile verify
+
+ifeq ($(USE_OPENSSL),1)
+CFLAGS +=3D -DUSE_OPENSSL `pkg-config --cflags openssl`
+LDLIBS +=3D `pkg-config --libs openssl`
+
+reglib.o: keys-ssl.c
+
+else
CFLAGS +=3D -DUSE_GCRYPT
LDLIBS +=3D -lgcrypt
=20
+reglib.o: keys-gcrypt.c
+
+endif
+
MKDIR ?=3D mkdir -p
INSTALL ?=3D install
=20
@@ -22,9 +35,6 @@ Q=3D@
NQ=3D@echo
endif
=20
-all: crda intersect
- $(Q)$(MAKE) --no-print-directory -f Makefile verify
-
keys-%.c: utils/key2pub.py $(PUBKEY_DIR)/$(wildcard *.pem)
$(NQ) ' GEN ' $@
$(Q)./utils/key2pub.py --$* $(PUBKEY_DIR)/*.pem > $@
@@ -33,8 +43,6 @@ keys-%.c: utils/key2pub.py $(PUBKEY_DIR)/$(wildcard *=
=2Epem)
$(NQ) ' CC ' $@
$(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
=20
-reglib.o: keys-ssl.c keys-gcrypt.c
-
crda: reglib.o crda.o
$(NQ) ' LD ' $@
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ reglib.o crda.o `pkg-config --li=
bs libnl-1` $(LDLIBS)
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* [crda PATCH 4/5] Don't use recursive make for verify target.
2008-12-01 10:30 [crda PATCH 0/5] Makefile improvement and fixes Diego 'Flameeyes' Pettenò
` (2 preceding siblings ...)
2008-12-01 10:31 ` [crda PATCH 3/5] Make it possible to switch gcrypt/openssl via knob Diego 'Flameeyes' Pettenò
@ 2008-12-01 10:31 ` Diego 'Flameeyes' Pettenò
2008-12-01 10:31 ` [crda PATCH 5/5] Ignore built files Diego 'Flameeyes' Pettenò
2008-12-01 22:35 ` [crda PATCH 0/5] Makefile improvement and fixes Luis R. Rodriguez
5 siblings, 0 replies; 7+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2008-12-01 10:31 UTC (permalink / raw)
To: linux-wireless
=46rom: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
This makes the build more parallel since regdbdump.o build and link
can happen in parallel with the keys generation and the build of the
rest of the units.
Signed-off-by: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
---
Makefile | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 4ac8495..a8c0a45 100644
--- a/Makefile
+++ b/Makefile
@@ -7,8 +7,7 @@ PUBKEY_DIR=3Dpubkeys
=20
CFLAGS +=3D -Wall -g
=20
-all: crda intersect
- $(Q)$(MAKE) --no-print-directory -f Makefile verify
+all: crda intersect verify
=20
ifeq ($(USE_OPENSSL),1)
CFLAGS +=3D -DUSE_OPENSSL `pkg-config --cflags openssl`
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* [crda PATCH 5/5] Ignore built files.
2008-12-01 10:30 [crda PATCH 0/5] Makefile improvement and fixes Diego 'Flameeyes' Pettenò
` (3 preceding siblings ...)
2008-12-01 10:31 ` [crda PATCH 4/5] Don't use recursive make for verify target Diego 'Flameeyes' Pettenò
@ 2008-12-01 10:31 ` Diego 'Flameeyes' Pettenò
2008-12-01 22:35 ` [crda PATCH 0/5] Makefile improvement and fixes Luis R. Rodriguez
5 siblings, 0 replies; 7+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2008-12-01 10:31 UTC (permalink / raw)
To: linux-wireless
=46rom: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
Signed-off-by: Diego E. 'Flameeyes' Petten=C3=B2 <flameeyes@gmail.com>
---
.gitignore | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index cc39545..8ee749e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,8 @@ regulatory.sqlite
regulatory.bin
crda
dump
+intersect
+regdbdump
*.o
*.pyc
keys-*.c
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [crda PATCH 0/5] Makefile improvement and fixes
2008-12-01 10:30 [crda PATCH 0/5] Makefile improvement and fixes Diego 'Flameeyes' Pettenò
` (4 preceding siblings ...)
2008-12-01 10:31 ` [crda PATCH 5/5] Ignore built files Diego 'Flameeyes' Pettenò
@ 2008-12-01 22:35 ` Luis R. Rodriguez
5 siblings, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2008-12-01 22:35 UTC (permalink / raw)
To: Diego 'Flameeyes' Pettenò; +Cc: linux-wireless@vger.kernel.org
On Mon, Dec 01, 2008 at 02:30:44AM -0800, Diego 'Flameeyes' Petten=F2 w=
rote:
>=20
>=20
> I've been asked by a colleague Gentoo developer (Tony Vroon) to look
> at a build failure with parallel make[1] in crda, and I decided to
> take a closer look to the Makefile.
>=20
> With these patches applied, --as-needed build works, as well as
> parallel make, the dependencies are properly handle so that changing =
a
> file will only rebuild the correct one, and it's as parallel as
> feasible with no recursive make.
Thanks applied.
Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread