ACE Makefile Hints

So, you want to write a makefile that will peacefully co-exist within the framework of ACE's make structure, eh? Fool!!!!

Seriously, it is not difficult, but there is no documentation on the system in use, either. The following serves as notes mainly to myself so that I don't forget how I did it.


Where do I start?

The easiest thing to do is to find a makefile that accomplishes a task similar to what you want to do and copy it, then modify it to suit your needs. Use the table below to help find reasonable prototypes.

Task Prototype/Example
Build in subdirectories $(WRAPPER_ROOT)/Makefile
Construct a library (.so or .a) $(WRAPPER_ROOT)/ace/Makefile
Construct a binary $(WRAPPER_ROOT)/examples/Logger/client/Makefile
ORBIX-related $(WRAPPER_ROOT)/examples/CORBA/Makefile

What are all these *.GNU files that are included?

Those form the make framework. They are required. Just put them in and leave them alone for now. To gain a deeper understanding of what's happening, you can dig into them. They are:


What are the default targets?

Target Requirements

What variables can be used, and what do they mean?

Variable Meaning Example
FILES A whitespace-separated list of file basenames which will be combined to form the ultimate target, e.g., the library or the binary. To compose a library from foo.o, bar.o, and blat.o, use:
FILES = foo bar blat
	    
LIB The name of an archive-style library target. libACE.a
SHLIB The name of an shared library target. libACE.so
MAKEFILE The name of the file from which make should read its directives. To instruct make to read directives from Instructions, use:
MAKEFILE = Instructions
	  
ACELIB Used to specify the ACE library when building executables. The default is -lACE. This can be overridden in either individual makefiles or in the platform_macros.GNU file. To force a static build (i.e., to use libACE.a) specify: ACELIB = -Bstatic -lACE -Bdynamic.

Chris Cleeland
Last modified: Mon Aug 11 21:08:04 CDT 1997