Problems compiling .c files in the rogue/mathsrc directory

Article ID: 841
Last updated: 05 Feb, 2008
Article ID: 841
Last updated: 05 Feb, 2008
Revision: 1
Views: 2899
Posted: 27 Jun, 1997
by Dean J.
Updated: 05 Feb, 2008
by Dean J.
Problem


I am having problems compiling .c files in the rogue/mathsrc directory that came with Math.h++.


Cause


Certain operating system vendors provide a free C compiler with the operating system. Usually this is an older, outdated C compiler.

A default rule for C files is usually also provided by the make utility itself.

The Rogue Wave makefile in the mathsrc directory does not provide its own rule for C compilations. Thus, you get the default system-provided rule for C files in the makefile. If your C compiler has a name other than cc, or if the intended compiler comes later in your PATH than a non-intended compiler, the intended compiler will not be called.


Action


Add .c to the list of SUFFIXES in the makefile

.SUFFIXES: .c .cpp .C .cc .cxx .o
Now add a rule at the bottom of the makefile:
.c.o:
clcc -c $(CFLAGS) $(SPECIAL) $<
Where clcc is the name of the CenterLine C compiler.

Another example is:

.c.o:
/package/1/sun.compilers/C++3.0.1/cc -c $(CFLAGS) $<
Where /package/1/sun.compilers/C++3.0.1/cc is an optional SunPro C compiler.

This should allow your library to build successfully.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 841
Last updated: 05 Feb, 2008
Revision: 1
Views: 2899
Posted: 27 Jun, 1997 by Dean J.
Updated: 05 Feb, 2008 by Dean J.

Others in this category