delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/05/17/15:00:33

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Lorenzo Dieryckx" <slavearcDOEDITWEG AT pandora DOT be>
Newsgroups: comp.os.msdos.djgpp
Subject: problem with DJGPP's make
Lines: 79
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <CW7qc.610$4P.230404138@hestia.telenet-ops.be>
Date: Mon, 17 May 2004 18:57:38 GMT
NNTP-Posting-Host: 213.224.114.17
X-Complaints-To: abuse AT telenet DOT be
X-Trace: hestia.telenet-ops.be 1084820258 213.224.114.17 (Mon, 17 May 2004 20:57:38 CEST)
NNTP-Posting-Date: Mon, 17 May 2004 20:57:38 CEST
Organization: Telenet Internet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello,

Sometimes, when I build applications through the use
of a makefile, Make doesn't quite respond as I would expect.

Since my applications or libraries are in C++, I set gxx is my CC variable,
but sometimes, make calles gpp instead, and also omits my include paths!!

The strange thing is, that some files work correctly, and others don't.

Example:
CC = gxx
CFLAGS = -c
AR = ar
ARFLAGS = -ru
INCLUDE = -I .\
   -I D:/Include

TARGET = libio.a

OBJS =  \
 FileByteSource.o

SRCS =  \
 FileByteSource.cpp

HDRS =  index.h \
 IByteSource.h \
 FileByteSource.h

$(TARGET) : $(OBJS)
 $(AR) $(ARFLAGS) $@ $<

%.o : $(patsubst %.o, %cpp, $(OBJS)) $(HDRS)
 $(CC) $(CCFLAGS) $(INCLUDE) $@ $<

when I try to make this, I see this on the commandline:
gpp        -c -o FileByteSource.o FileByteSource.cpp
(notice the spaces between gpp and -c!)
Of course, since the include paths are omited, the file fails to compile


Yet some other files which are quite similar compile without any problem!

Example:
CC = gxx
CCFLAGS = -c
AR = ar
ARFLAGS = -ru
INCLUDE = -I .\
          -I D:/Include


SRC = BinTreeNode.cpp
HDR = index.h \
      BinTreeNode.h
OBJ = BinTreeNode.o
OUTPUT = libtree.a

##
# Dependencies and build rules
##
$(OUTPUT) : $(OBJ)
 $(AR) $(ARFLAGS) $(OUTPUT) $(OBJ)

$(OBJ) : $(SRC) $(HDR)
 $(CC) $(CCFLAGS) $(INCLUDE) -o $@ $(SRC)

gxx -c -I . -I D:/Include -o BinTreeNode.o BinTreeNode.cpp
which is the correct output!


Has anybody experienced this problem before?
or does anybody see some errors in my makefiles?

Thanks!
Lorenzo


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019