Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Makefile related question. Please Help!

Status
Not open for further replies.

Ghenadie

Technical User
Feb 15, 2001
17
RO
What is the equivalent for the folowing comands in AIX?
GLIBS=${LK_LIBS:%=-l%} - Solaris, Redhat
GLIBS=${LK_LIBS/^/-l} - Mandrake, Tru64

Is that i have to build the executable specifying the shared libraries and there are several hundreds of them and i have to put an "-l" in front of them.
As they are in a variable GLIBS separated by spaces these commands would do the trick on the operating system mentioned above. HOW ABOUT AIX?
I tried every possibility and every doc, but couldn't find?
Am I missing something?

Thanks a lot
 
This is all we have for our makefiles :
GENERAL_MAKEFILE = makec
GENERAL_MAKEFILE_DIR = $(SRC_BASE)/c/makegeneral/SCCS

TASK = utget_write

OUTPUT_DIR = .

SCCS_DIR= $(SRC_BASE)/c/$(TASK)/SCCS
LIB_DIRS= -L. -L$/projects/lib -L/usr/cg-index/lib
LIBS = -lspool -lsc -lsysutils -lcurses -lm -lcg-index -lcgutils

DEPENDANCIES=

PROGLIST=utget_write.c

GET_CMD = $(PRJ_BASE)/cmds/getcmd -R

SCCS_FLAGS = -t

all .DEFAULT: $(GENERAL_MAKEFILE) FORCE
make $! -f $(GENERAL_MAKEFILE) "TASK=$(TASK)" "SCCS_DIR=$(SCCS_DIR)" "LIB_DIRS=$(LIB_DIRS)" "LIBS=$(LIBS)" "PROGLIST=$(PROGLIST)" "OUTPUT_DIR=$(OUTPUT_DIR)" "DEPENDANCIES=$(DEPENDANCIES)" "GET_CMD=$(GET_CMD)" "SCCS_FLAGS=$(SCCS_FLAGS)"

$(GENERAL_MAKEFILE): $(GENERAL_MAKEFILE_DIR)/s.$$@
$(GET_CMD) $(SCCS_FLAGS) $(GENERAL_MAKEFILE_DIR)/s.$@

FORCE:


NB all indents are tabs, not spaces.
HTH
Dickie Bird (:)-)))
 
Thanks for the repply.
I'm dealling with the macros like these one of yours
LIBS= -lspool -lsc -lsysutils -lcurses -lm -lcg-index -lcgutils

I's just that I'm generating a lot of shared libs and I keep all the names in a macro (variable). So, on Solaris for example if I have
A="lib1 lib2 lib2 .... lib100"
B=${A:%=-l%} then I get B="-llib1 -llib2 -llib3 ...-llib100"

I was wondering how to do it in AIX as I've tried similar things and it didn't work.

Thanks
 
From the manual :
Variable substitution occurs at two distinct times, depending on where the variable is being used. Variables in dependency lines are expanded as the line is read. Variables in shell commands are expanded when the shell command is executed.

The four classes of variables (in order of increasing precedence) are:

Environment Variables defined as part of the make command's environment.
Global Variables defined in the makefile or in included makefiles.
Command line Variables defined as part of the command line.
Local Variables defined specific to a certain target. The local variables are as follows: $< Represents either the full name of a prerequisite that made a target out-of-date (inference rule), or the full name of a target (.DEFAULT rule).
$* Represents the file name section of a prerequisite that made a target out-of-date (in an inference rule) without a suffix.
$@ Represents the full target name of the current target or the archive file name part of the library archive target.
$% Represents a library member in a target rule if the target is a member of the archive library.

So - precede % with a $ sign ?????????


Dickie Bird (:)-)))
 
Yes, I've tried that, but it seems that it doesn't work.

Anyway, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top