[ace-users] ACE: Need a makefile for building a library of components that use ACE.

[ace-users] ACE: Need a makefile for building a library of components that use ACE.

Post by Robert Tho » Fri, 22 Sep 2006 02:32:40


his is a multi-part message in MIME format.


Hello,

I hope this is an easy question for someone:

ACE VERSION: 5.5.1

HOST MACHINE and OPERATING SYSTEM:
RedHat Enterprise Linux Version 4
gcc (GCC) 3.4.5 20051201 (Red Hat 3.4.5-2)
GNU Make 3.80

THE $ACE_ROOT/ace/config.h FILE :
#include "ace/config-linux.h"

THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE :
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU

CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
I am not using MPC. Should I use it for a simple job? I could not
find the default.features file.

DESCRIPTION:
I am trying to build a small object library which can be used to
build other applications.
I can build an application that works with these modules if I just
compile and link everything together
but it would be useful if I could make an object library.
I am having trouble with the makefile. I am using the example from
the APG but it is not working.
I am hoping for advice but I will figure it out on my own if
necessary.

Here is my makefile:
SHLIB = DR_STIZ.$(SOEXT)
FILES = DR_STIZ DR_STIZ_Messages Configuration
LSRC = $(addsuffix .cpp, $(FILES))
LIBS += $(ACELIB)
BUILD = $(VSHLIB)
#----------------------------------------------------
# Include macros and targets
#----------------------------------------------------
include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
include $(ACE_ROOT)/include/makeinclude/macros.GNU
include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
#----------------------------------------------------
# Local targets
#----------------------------------------------------
CPPFLAGS += -DLINUX -I../ias_common
ifeq ($(shared_libs),1)
ifneq ($(SHLIB),)
CPPFLAGS += -DSLD_BUILD_DLL
endif
endif
#%.o : %.cpp
# $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

Here is what I get when I run make:
[bthornth@roer ias_dr_stiz]$ make
GNUmakefile: /user/bthornth/workarea/ias_dr_stiz/GNUmakefile MAKEFLAGS=
[bthornth@roer ias_dr_stiz]$


SYNOPSIS:
How does one make a makefile for building a library of components that
use ACE?


Thank you.

Regards,
Bob


This email and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the original recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error, and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you received this email in error, please immediately notify the sender and delete the original.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV><FONT face=Arial size=2><SPAN
class=724132817-20092006>Hello,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=724132817-20092006></SPAN></FONT> </DIV>
<DIV><FONT face=
 
 
 

[ace-users] ACE: Need a makefile for building a library of components that use ACE.

Post by Chad Ellio » Fri, 22 Sep 2006 03:15:31

Hi Bob,

[snip]

Use MPC to generate one for you.

1) Create an MPC file for your library named Dr_Stiz.mpc:

project: acelib {
sharedname = DR_STIZ
macros += LINUX
includes += ../ias_common
dynamicflags += SLD_BUILD_DLL
}

2) Run MPC in the same directory as your .mpc file:

$ACE_ROOT/bin/mwc.pl -type gnuace

3) Run GNU make.

Item number 1 assumes that you have only the source files for your library in
the directory.

HTH,
Chad Elliott
Object Computing, Inc.