I'm
having issues, but I am not sure they are bugs.
Here's the situation. I am porting my company's product to
Linux from HP-UX. We set up generic include files define the patterns for
building.
For
example, our include file for building libs has the following
entries:
ifdef
LIB1-LINUX-NAME
CCFLAGS = $(LIB1-LINUX-CCFLAGS) $(GLOBALCCLIBFLAGS) LDFLAGS = $(LIB1-LINUX-LDFLAGS) $(GLOBALLDLIBFLAGS) endif $(LIB1-LINUX-OBJDIR)/%.o:
%.cc
$(CCC) $(CCLIBFLAGS) -c -o $@ $< $(LIB1-LINUX-NAME):
$(LIB1-LINUX-OBJ)
$(CCC) $(LDFLAGS) -o $(LIB1-LINUX-NAME) $(LIB1-LINUX-OBJ) @cp -f $(LIB1-LINUX-NAME) $(PROJLIB-LINUX-PATH)/$(LIB1-LINUX-BASE) @echo "$(LIB1-LINUX-NAME) -> $(PROJLIB-LINUX-PATH)/$(LIB1-LINUX-BASE)" And
for exes:
ifdef
EXE1-LINUX-NAME
CCFLAGS = $(EXE1-LINUX-CCFLAGS) LDFLAGS = $(EXE1-LINUX-LDFLAGS) endif $(EXE1-LINUX-OBJDIR)/%.o:
%.cc
$(CCC) $(CCFLAGS) -c -o $@ $< $(EXE1-LINUX-NAME):
$(EXE1-LINUX-OBJ)
$(CCC) -o $(EXE1-LINUX-NAME) $(EXE1-LINUX-OBJ) $(LDFLAGS) Our Makefile defines the
following:
GENCCFLAGS =
$(PROJCCFLAGS) $(PROJINCFLAGS) $(RWCCFLAGS)
GENCCFLAGS += $(STLCCFLAGS) $(VTHREADCCFLAGS) LIB1
= vsutil
LIB1OBJFILES = BaseException.o itoa.o \ GenericQueueException.o \ CallTime.o CallID.o CallIDGenerator.o CRUD.o \ Timer.o TimerManager.o \ TimerThread.o TimeInterval.o CallClearInfo.o RWLock.o \ StringStreamBuffer.o #
LIB1-LINUX-OBJDIR = obj-linux LIB1-LINUX-BASE = lib$(LIB1)$(SHAREDLIBEXT) LIB1-LINUX-NAME = $(LIB1-LINUX-OBJDIR)/$(LIB1-LINUX-BASE) LIB1-LINUX-CCFLAGS = $(GENCCFLAGS) $(ORBCCFLAGS) -D_POSIX_PTHREAD_SEMANTICS #LIB1-LINUX-LDFLAGS = LIB1-LINUX-OBJ = $(LIB1OBJFILES:%=$(LIB1-LINUX-OBJDIR)/%) EXE1NAME
=
timertest
EXE1OBJ = timertest.o EXE1CCFLAGS = $(GENCCFLAGS) EXE1LDFLAGS = -lrt EXE1-LINUX-OBJDIR =
obj-linux
EXE1-LINUX-NAME = $(EXE1-LINUX-OBJDIR)/$(EXE1NAME) EXE1-LINUX-CCFLAGS = $(EXE1CCFLAGS) EXE1-LINUX-LDFLAGS = $(PROJUTIL-LINUX-LDFLAGS) $(VTHREAD-LINUX-LDFLAGS) $(RWLDFLAGS) $(EXE1FLAGS) EXE1-LINUX-OBJ = $(EXE1OBJ:%=$(EXE1-LINUX-OBJDIR) What I have found is that when compiling, the only variable that
is used is the "GENCCFLAGS", even though I use the variable to
create the "LIB1-LINUX-CCFLAGS" in the Makefile. The value of
"LIB1-LINUX-CCFLAGS" is set correctly, but it just isn't used. Can you
tell me why?
I
also found that the variables are always set to the last value set to it, not
the value it is currently being set to. For example, the "LDFLAGS" used in
the linking of LIB1 will be the "LDFLAGS" is not equal to
"LIB1-LINUX-LDFLAGS", but to "EXE1-LINUX-LDFLAGS". I can probably fix
this by renaming "LDFLAGS" to a value specific to the build I am doing, but I
just want to make sure that's the way it suppose to work before I
start.
Thanks,
Rick Merola
|
Title: Blank
- Re: gmake issues on Linux Rick Merola
- Re: gmake issues on Linux Paul D. Smith
- RE: gmake issues on Linux Rick Merola