This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/libdecnumber] Fix to compile with Solaris make


Hi folks,

My previous patch to the libdecnumber build system enabled libdecnumber
to be built by native make on *BSD, but Solaris' make still doens't
work.

The problem is that in that version of make, the $< automatic variable
is not set for targets that have an explicit compilation rule instead of
using the .c.o default rule.

This patch substitutes the $< variable for the explicit name of the
source file which should be compiled in those targets that define a
compilation rule.

It also prepends $(srcdir) to the path of files that reside in a
subdirectory of the libdecnumber source tree, for completeness.

I tested by compiling libdecnumber on Solaris, Linux and OpenBSD.

Is this ok?
-- 
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center
2007-11-07  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* Makefile.in (decimal32.o): Prepend $(srcdir) to dependencies
	and substitute $< for the source file in compilation command.
	(decimal64.o): Likewise.
	(decimal128.o): Likewise.
	(bid2dpd_dpd2bid.o): Likewise.
	(host-ieee32.o): Likewise.
	(host-ieee64.o): Likewise.
	(host-ieee128.o): Likewise.

Index: libdecnumber/Makefile.in
===================================================================
--- libdecnumber.orig/Makefile.in	2007-11-07 15:40:51.000000000 -0200
+++ libdecnumber/Makefile.in	2007-11-07 15:55:17.000000000 -0200
@@ -115,30 +115,30 @@ decContext.o: decContext.c decContext.h 
 	decContextSymbols.h
 decNumber.o:  decNumber.c decNumber.h decContext.h decNumberLocal.h \
 	decNumberSymbols.h
-decimal32.o:  $(enable_decimal_float)/decimal32.c \
-   $(enable_decimal_float)/decimal32.h \
-   $(enable_decimal_float)/decimal32Symbols.h \
+decimal32.o:  $(srcdir)/$(enable_decimal_float)/decimal32.c \
+   $(srcdir)/$(enable_decimal_float)/decimal32.h \
+   $(srcdir)/$(enable_decimal_float)/decimal32Symbols.h \
    decNumber.h decContext.h decNumberLocal.h
-	$(COMPILE) $<
-decimal64.o:  $(enable_decimal_float)/decimal64.c \
-   $(enable_decimal_float)/decimal64.h \
-   $(enable_decimal_float)/decimal64Symbols.h \
+	$(COMPILE) $(srcdir)/$(enable_decimal_float)/decimal32.c
+decimal64.o:  $(srcdir)/$(enable_decimal_float)/decimal64.c \
+   $(srcdir)/$(enable_decimal_float)/decimal64.h \
+   $(srcdir)/$(enable_decimal_float)/decimal64Symbols.h \
    decNumber.h decContext.h decNumberLocal.h
-	$(COMPILE) $<
-decimal128.o:  $(enable_decimal_float)/decimal128.c \
-   $(enable_decimal_float)/decimal128.h \
-   $(enable_decimal_float)/decimal128Symbols.h\
-   $(enable_decimal_float)/decimal128Local.h\
+	$(COMPILE) $(srcdir)/$(enable_decimal_float)/decimal64.c
+decimal128.o:  $(srcdir)/$(enable_decimal_float)/decimal128.c \
+   $(srcdir)/$(enable_decimal_float)/decimal128.h \
+   $(srcdir)/$(enable_decimal_float)/decimal128Symbols.h\
+   $(srcdir)/$(enable_decimal_float)/decimal128Local.h\
    decNumber.h decContext.h decNumberLocal.h 
-	$(COMPILE) $<
-bid2dpd_dpd2bid.o : bid/bid2dpd_dpd2bid.c bid/bid2dpd_dpd2bid.h
-	$(COMPILE) $<
-host-ieee32.o : bid/host-ieee32.c bid/decimal32.h
-	$(COMPILE) $<
-host-ieee64.o : bid/host-ieee64.c bid/decimal64.h
-	$(COMPILE) $<
-host-ieee128.o : bid/host-ieee128.c bid/decimal128.h
-	$(COMPILE) $<
+	$(COMPILE) $(srcdir)/$(enable_decimal_float)/decimal128.c
+bid2dpd_dpd2bid.o : $(srcdir)/bid/bid2dpd_dpd2bid.c $(srcdir)/bid/bid2dpd_dpd2bid.h
+	$(COMPILE) $(srcdir)/bid/bid2dpd_dpd2bid.c
+host-ieee32.o : $(srcdir)/bid/host-ieee32.c $(srcdir)/bid/decimal32.h
+	$(COMPILE) $(srcdir)/bid/host-ieee32.c
+host-ieee64.o : $(srcdir)/bid/host-ieee64.c $(srcdir)/bid/decimal64.h
+	$(COMPILE) $(srcdir)/bid/host-ieee64.c
+host-ieee128.o : $(srcdir)/bid/host-ieee128.c $(srcdir)/bid/decimal128.h
+	$(COMPILE) $(srcdir)/bid/host-ieee128.c
 # Other miscellaneous targets.
 
 mostlyclean:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]