make gives exit status of 0 even when compile fails

2009-11-23 Thread David Aldrich
Hi We are running GNU make 3.81 on Centos Linux. I find that our make system returns an exit status of 0 even though a file fails to compile. make --stop -d gives the following snippet: Must remake target `_gnuRelease/CdfDialog.o'. Putting child 0x0b5ed9d0 (_gnuRelease/CdfDialog.o) PID 27900

RE: make gives exit status of 0 even when compile fails

2009-11-23 Thread David Aldrich
Hi Paul Thanks for your reply. Your post crossed with another of mine, where I explained that I had identified the problem. Best regards David ___ Help-make mailing list Help-make@gnu.org http://lists.gnu.org/mailman/listinfo/help-make

Breaking from a for loop?

2009-11-23 Thread David Aldrich
Hi Our top level makefile builds a number of dynamic libraries, each of which has its own makefile. Here are parts of the makefile (simplified): DYNAMIC_LIBS = $(TRUNKDIR)/MyLibs/Lib1/lib1 DYNAMIC_LIBS += $(TRUNKDIR)/MyLibs/Lib2/lib2 DYNAMIC_LIBS += $(TRUNKDIR)/MyLibs/Lib3/lib3 DYNAMIC_LIBS +=

RE: Breaking from a for loop?

2009-11-24 Thread David Aldrich
Hi Philip >Answer #1: it's just a /bin/sh 'for' loop; the shell's 'break' >built-in works there: Thanks very much for your answer. I have modified my code accordingly and laid the shell script out better: .PHONY : makedynamiclibs makedynamiclibs : for d in $(DYNAMIC_LIBS); do

RE: Breaking from a for loop?

2009-11-24 Thread David Aldrich
Hi Paul > Only a backslash followed immediately by a newline escapes the newline. Spot on, that fixed that error. Thanks. I now have a different problem: .PHONY : makedynamiclibs makedynamiclibs : @for d in $(DYNAMIC_LIBS); do\ echo $$d;

RE: Breaking from a for loop?

2009-11-24 Thread David Aldrich
Hi Paul > Well, one problem is that ">" is a string comparison operator not an > integer comparison operator. Sorry, that was rather stupid of me. It's working fine now. I also wanted to: 1) Pass the top-level command line arguments to the lower-level makefile 2) Not break if --keep-going was

RE: Breaking from a for loop?

2009-11-24 Thread David Aldrich
Hi Paul > This is the second excellent reason why you should be using make > constructs to do this rather than shell constructs: if you use make > constructs then all handling of -k etc. works correctly (the first > reason was already mentioned by Philip: to get better support for > parallelism).

Request for review of failing makefile

2009-12-17 Thread David Aldrich
Hi I have a problem with my makefile and would appreciate a peer review please. The makefile builds an .exe file from C++ source code and a static library. The static library has its own separate makefile. I find that if I touch a source file component of the static library and then execute th

RE: Request for review of failing makefile

2009-12-18 Thread David Aldrich
Hi Maxim and Bart Thanks very much for reviewing my makefile. Your suggestion of an extra command did indeed solve my problem. That's great. My reason for not replying sooner is that I am testing other parts of the makefile. What I sent was actually a simplified version. The real version had:

RE: Request for review of failing makefile

2009-12-21 Thread David Aldrich
Hi Maxim and Bart May I come back to you about your answers last week? Maxim wrote: > The above says that $(ARCHIVES_R) depend on a phony target > $(STATIC_LIBS). What it does not say is how to update $(ARCHIVES_R), so > that make considers $(ARCHIVES_R) to be always up-to-date, although its > p

RE: Request for review of failing makefile

2009-12-22 Thread David Aldrich
Hi Bart > It is typical to make the command empty, e.g. > target: prereqs ; Thanks for your solution. That works nicely. Best regards David ___ Help-make mailing list Help-make@gnu.org http://lists.gnu.org/mailman/listinfo/help-make

No console message when making library

2010-06-03 Thread David Aldrich
Hi Our software application consists of a kernel executable and several shared libraries. Our makefiles build the libraries and executable correctly. However, there is one minor inconvenience, when a source file changes, which is a component of a shared library, the compilation command for the

RE: No console message when making library

2010-06-03 Thread David Aldrich
Hi Philip Thank you for your reply. > Do any of your Makefiles (or the files they include) use the .SILENT > target? None that I can see. > Is the LIBTOOLCMD defined to start with an '@' ? No. The strange thing is that none of the commands in the block below are echoed except for the echo co

RE: No console message when making library

2010-06-07 Thread David Aldrich
Hi Philip I found that the makefile in question was invoked by a higher level makefile using --quiet (-s as you suggested). Thanks for your help, David ___ Help-make mailing list Help-make@gnu.org http://lists.gnu.org/mailman/listinfo/help-make

Problem with make clean

2011-05-19 Thread David Aldrich
Hi I have noticed a minor difference in behaviour of 'make clean' when upgrading from Centos 5.3 to Centos 5.5. When I run 'make clean' in Centos 5.3, I get no warnings. When I run it in Centos 5.5 I get: "Warning: --directory (-d) option is undocumented and no-op. Use -rf for deleting non-e

RE: Problem with make clean

2011-05-19 Thread David Aldrich
> There is no implicit clean target. > > If you run "make clean" and something happens, then somewhere in your > makefile environment you have created a "clean" target and that target is > being invoked. There's no built-in version of "clean". Thanks Paul, sorry for my dumb question. I have now

Sticky bit problem

2011-06-16 Thread David Aldrich
Hi We are using gnu make 3.81 and gcc 4.12 to build our Linux app. The working directory is on a remote machine and is either a Samba share or a Windows 7 share. We find that in the case of a Windows share the resulting executable has the sticky bit set: On Windows 7 share: -rwxrwSrwx 1 my

Specifying include paths for different library versions

2011-09-29 Thread David Aldrich
Hi We have restricted our application to build and run on Centos 5.x o/s, which means that it always links to Python 2.4. So our makefile contains: PYTHON = /usr/include/python2.4 INCPATH=$(PYTHON) However, now we want to build on other systems that will have later versions of Python. What i

Help needed to check whether a directory exists

2011-11-21 Thread David Aldrich
Hi Our C++ app uses the Boost library. On platforms that we target, Boost header files may be in /usr/include/boost or /usr/include/boost141. Likewise, the Boost library files may be in various directories. So I want my makefile to check whether /usr/include/boost141 exists in order to set th

RE: Help needed to check whether a directory exists

2011-11-22 Thread David Aldrich
> The text above is resolving into a variable assignment (!!): > > if test -d /usr/[...]tory; BOOST_INC := /usr/include/boost141; [...] > > which is why you're not getting an error. Believe it or not that's a valid > variable assignment statement in GNU make. > > You'll want to do something lik

make is setting exit code to 0 when gcc command fails

2015-02-09 Thread David Aldrich
Hi I want to call make from a Python script and check make's exit code to decide whether the make succeeded. If I deliberately introduce a syntax error into one of my C files, make calls gcc to build the file, as expected, and an error is reported as text in bash. However, the exit code (chec

RE: make is setting exit code to 0 when gcc command fails

2015-02-10 Thread David Aldrich
Thanks for your replies. I haven't fixed this yet. > Why don't you provide a sample of the makefile that doesn't work? Here is the essence of my makefile (which makes a static library): # List the object files that comprise this library OBJFI

RE: make is setting exit code to 0 when gcc command fails

2015-02-10 Thread David Aldrich
> This is bad. The simplest way to fix it is to replace the ";" with "&&", so > that > subsequent parts of the script don't run if an earlier part fails: Thanks very much for your help. That has fixed my problem. Best regards David ___ Help-make ma

How to switch behaviour according to glibc version?

2016-04-05 Thread David Aldrich
Hi I am running gnu make 4.1 on Ubuntu. Make builds my C++ application that requires glibc 2.22 or higher. Ubuntu 14.04 has only glibc 2.19 so my makefile checks the host o/s and, if it's Ubuntu, it links to my private copy of glibc 2.22: GLIBC_FLAGS= ifeq ($(DISTRO),debian) echo "Warnin

RE: How to switch behaviour according to glibc version?

2016-04-05 Thread David Aldrich
Hi David Thanks for your answer to my question. I have one outstanding problem. Part of the makefile is now: ifeq ($(DISTRO),debian) verstr := $(ldd --version | head -1 | awk '{print $NF}') @echo glibc $(verstr) detected ifneq ($(call version_ge,$(verstr),2.22),TRUE) @echo "Warning: sy

RE: How to switch behaviour according to glibc version?

2016-04-06 Thread David Aldrich
il.com] On Behalf Of David Boyce Sent: 05 April 2016 18:36 To: David Aldrich Cc: help-make@gnu.org Subject: Re: How to switch behaviour according to glibc version? Makefiles are divided between make syntax and shell (recipe) syntax. Here you're trying to use a shell command (echo) in a pla

RE: How to switch behaviour according to glibc version?

2016-04-06 Thread David Aldrich
> So, write: > > verstr := $(shell ldd --version | head -1 | awk '{print $$NF}') Thanks Paul, that worked fine. David ___ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make

RE: How to switch behaviour according to glibc version?

2016-04-06 Thread David Aldrich
> How can "make" could build a C++ application that depends on glibc 2.22 when > your system only have glibc 2.19 ? glibc 2.19 has a bug that is critical for us. I don't want to upgrade the version of the system's glibc because that could break other applications. I have a copy of glibc 2.22 tha

Problem when source and object files are in different paths

2016-09-28 Thread David Aldrich
Hi My project looks like: ├── build │   |── makefile | └── src ├── subsys1 │   ├── includes │   └── src_1.cpp └── subsys2 ├── includes └── src_2.cpp I want the object files and executable to be stored in the build directory. My makefile has: OBJDIR = _gnuRelease