Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Nov 2015 20:09:04 -0553.75
From:      "William A. Mahaffey III" <wam@hiwaay.net>
To:        FreeBSD Questions !!!! <freebsd-questions@freebsd.org>
Subject:   gmake question
Message-ID:  <565CFFF6.8070709@hiwaay.net>

Next in thread | Raw E-Mail | Index | Archive | Help


I am using gmake under FreeBSD 9.3R to (try to) maintain some inhouse 
mixed language code (ANSI C, some c++, FORTRAN 77). I have a utility 
library which I use to hold C & c++ object files, using the 'target::' 
syntax. This works AOK under Linux (gmake 3.8.2), puts both types of 
objects in the same library smooth as silk. However under FreeBSD (gmake 
4.1.2), it only puts the 1st group of objects in, either the C or c++ 
depending on which is 1st in the makefile. When I try the 'target:' 
syntax, it wound up deleting some of my source files (!!!!!). I 
reproduce the relevant parts of the makefile below:


     .
     .
     .
     .

force:  clean  all

depend:
         @makedepend -- $(CFLAGS) -- -f Makefile $(SRCS)
         @\rm -f Makefile.bak
         @cp -p Makefile MakeUtils
         @echo MakeUtils: Done with $@.

iccdepend:
         @icc $(IFLAGS) -c -MM -MF depends.inc $(SRCS)
         @echo MakeUtils: Done with $@.

$(LIB):: $(CPPSRC)
         $(CC) $(CPPFLAGS) -c $?
         ar ruv $@ ${?:.cpp=.o} && rm -f ${?:.cpp=.o}
         @echo MakeUtils: Done with $@.

$(LIB):: $(SRCS)
         $(CC) $(CFLAGS) -c $?
         ar ruv $@ ${?:.c=.o} && rm -f ${?:.c=.o}
         @echo MakeUtils: Done with $@.

# DO NOT DELETE THIS LINE -- make depend depends on it.


CPPSRC lists the c++ files & SRCS lists the C files. Is this supposed to 
work under FreeBSD 9.3R & this version of gmake ? TIA for any pointers & 
have a good one.


BTW:

[wam@devbox, pre, 8:08:13pm] 2846 % uname -a
FreeBSD devbox 9.3-RELEASE-p30 FreeBSD 9.3-RELEASE-p30 #0: Mon Nov 2 
10:11:50 UTC 2015 
root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
[wam@devbox, pre, 8:08:16pm] 2847 % grep make /etc/LIST.installed.txt
automake-1.15_1                GNU Standards-compliant Makefile generator
automake-wrapper-20131203      Wrapper script for GNU automake
gmake-4.1_2                    GNU version of 'make' utility
libxklavier-5.3_1,1            Utility library to make XKB stuff easier
makedepend-1.0.5,1             Dependency generator for makefiles
[wam@devbox, pre, 8:08:53pm] 2848 %


-- 

	William A. Mahaffey III

  ----------------------------------------------------------------------

	"The M1 Garand is without doubt the finest implement of war
	 ever devised by man."
                            -- Gen. George S. Patton Jr.




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?565CFFF6.8070709>