Thread: Borland 5.5 Makefile woes...

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    7

    Borland 5.5 Makefile woes...

    Hey all, I am trying to make a makefile for my project... I found a template from what seems to be an older version of the Borland compiler. I though I converted everything over to be compatible with my version (5.5 free) but I guess not... the error I'm getting at this point is:

    Fatal: Unable to open file 'MAIN.OBJ'

    ### or *.OBJ respectively for any source ###

    here is the template I'm working from: (sorry in advance for the formatting)
    Read this and this(Salem)
    Code:
    ##########################################
    #
    PROJ = project			# the name of the project
    OBJS = main.obj io.obj		# list of object files 
    # Configuration:
    #
    MODEL = s32			# memory model
    CC = bcc32			# name of compiler 
    # Compiler-dependent section
    #
    %if $(CC) == bcc32		# if compiler is bcc
      CFLAGS = –m$(MODEL)	# $(CFLAGS) is –ms
      LDSTART = c0$(MODEL)	# the start-up object file
      LDLIBS = c$(MODEL)	# the library
      LDFLAGS = /Lf:\bc\lib	# f:\bc\lib is library directory
    %elif $(CC) == cl		# else if compiler is cl
      CFLAGS = –A$(MODEL,UC)	# $(CFLAGS) is –AS
      LDSTART =			# no special start-up
      LDLIBS =			# no special library
      LDFLAGS = /Lf:\c6\lib;	# f:\c6\lib is library directory
    %else				# else
    % abort Unsupported CC==$(CC)	# compiler is not supported
    %endif				# endif 
    # The project to be built
    #
    $(PROJ).exe : $(OBJS)
    	tlink $(LDSTART) $(OBJS), $(.TARGET),, $(LDLIBS) $(LDFLAGS) 
    #$(OBJS)   : incl.h              # if all have same include
    #main.obj : incl.h              # if individual includes
    #io.obj   : incl.h            	#
    #
    ##########################################
    
    
    and here is what I'm attempting to use:
    
    
    ##########################################
    #
    PROJ = project			# the name of the project
    OBJS = whatever.obj whatever.obj	# list of object files 
    # Configuration:
    #
    MODEL = s32			# memory model
    CC = bcc32			# name of compiler 
    # Compiler-dependent section
    #
    #%if $(CC) == bcc32		# if compiler is bcc
      CFLAGS = –m$(MODEL)		# $(CFLAGS) is –ms
      LDSTART = c0$(MODEL)		# the start-up object file
      LDLIBS = c$(MODEL)		# the library
      LDFLAGS = /Lc:\bcc\lib	# c:\bcc\lib is library directory
    #%elif $(CC) == cl		# else if compiler is cl
    #  CFLAGS = –A$(MODEL,UC)	# $(CFLAGS) is –AS
    #  LDSTART =			# no special start-up
    #  LDLIBS =			# no special library
    #  LDFLAGS = /Lc:\c6\lib;	# c:\c6\lib is library directory
    #%else				# else
    #% abort Unsupported CC==$(CC)  # compiler is not supported
    #%endif				# endif 
    # The project to be built
    #
    $(PROJ).exe : $(OBJS)
    	ilink32 $(LDSTART) $(OBJS), $(.TARGET),, $(LDLIBS) $(LDFLAGS) 
    $(OBJS)     : incl.h              # if all have same include
    #main.obj : incl.h              # if individual includes
    #io.obj      : incl.h              #
    #
    ##########################################
    Ok what I changed was the MODEL and CC, added a 32 to each to correspond to which I think are the respective files in my version.

    Also, the tlink command in the exe command line, I changed to ilink32. Again, thinking that may be the equivalent in my version.

    The LDFLAGS to my directory, C:\Bcc\Lib.

    I also commented out the Compiler switch section for now, plus I would get an error there anyways before. Also un-commented an incl.h file associated with both sources.

    Afer attempting to run make I get the errors, unable to open the *.obj file. If anyone has a fix for this it would be greatly appreciated! I hope its just something easy that I'm missing.

    The output is defined in bcc32.cfg to C:\Bcc\Compiled... maybe I have to specify something there, since it's unable to open the output at this point in the process. For giggles I added that to the LDFLAGS directory, though not to my surprise, no luck.

    Thanks in advance, I hope everyone is having a good weekend!

    ~G

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    7
    Heh... *bangs head on keyboard*

    Thanks Salem!

    However, it is so late right now for me, can you help me decipher where to change the include/output directories, and insert my source files and desired exe name?

    If not, I understand and I'll eventually figure it out but, if you wouldn't mind it would be greatly appreciated!

    Thanks again!

    Take care.

    ~G

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    7
    Okay, I think I'm getting there... I get it compiled, and I get an exe file but it doesn't do exactly what it should. My code could be slightly off to be causing the problem with the exe but I'm not sure. It compiles to exe, however I get this error:

    Fatal: 'accum.obj' does not exist - don't know how to make it

    Would that affect the exe? Or should I check my source code first? (heh, probably before posting this, but oh well) Any further support would be greatly appreciated!

    I can't say thanks enough!

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    7
    Please just put a gun to my head and disregard all future posts by me...

    I guess I should rename myself to "Premature poster"

    Thanks for all the help though, however, problem solved!

    Take care everyone!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 11:50 PM
  2. Need help with Makefile
    By xshapirox in forum C++ Programming
    Replies: 14
    Last Post: 09-28-2004, 03:32 PM
  3. about Makefile and Macro
    By tom_mk in forum C++ Programming
    Replies: 1
    Last Post: 09-18-2003, 01:07 PM
  4. makefile woes
    By darfader in forum C Programming
    Replies: 2
    Last Post: 08-08-2003, 02:44 AM
  5. makefile woes
    By Grifftt in forum C Programming
    Replies: 2
    Last Post: 12-06-2002, 04:43 PM