Find the answer to your Linux question:
Results 1 to 3 of 3
Hello all. I have been workin on this makefile for a very long time now and i cannot get it to work. The file is for a pascal compiler and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Posts
    2

    Pascal Makefile Problem


    Hello all.
    I have been workin on this makefile for a very long time now and i cannot get it to work.
    The file is for a pascal compiler and we just need to run it for school.
    The files are located in /root/Desktop/epc/ctrl.
    This folder contains a ctrl.h and ctrl.c
    Here is the makefile below:

    CPP = g++
    PROGRAM: ctrl.h ctrl.o
    Ctrl.o ../scanparse/scanparse.h ../p_tree/p_tree.h
    ../symtab/symtab.h ..ctrl/ctrl.h ctrl.C
    ${CPP} -c -g ctrl.C

    This makefile makes a Ctrl.o file for the control part of the pascal compiler.
    However, it gives me an error stating: "No rule to make target 'ctrl.C', needed by ctrl.o. STOP.
    If I take away the ../scanparse/ in front of scanparse.h then I get the same error above just with scanparse.h in it.
    Why won't this file make the ctrl.o like it should.

    Please help me ASAP.
    It is probably a simple error, but i cannot find it.

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    how are you calling the make file? (i.e. "make -what?-")

  3. #3
    Linux User
    Join Date
    Jul 2004
    Location
    Poland
    Posts
    368
    Very long time? The first thing, it seems that you spent 5 minutes on writing the makefile and 5 seconds on writing your post. Now I don't know if this is the source of your problem, by try changing:
    Code:
    Ctrl.o ../scanparse/scanparse.h ../p_tree/p_tree.h ../symtab/symtab.h ..ctrl/ctrl.h ctrl.C
    to:
    Code:
    Ctrl.o: ../scanparse/scanparse.h ../p_tree/p_tree.h ../symtab/symtab.h ../ctrl/ctrl.h ../ctrl/ctrl.C
    If ctrl.h and ctrl.C are in the same directory then why do you access the first with ../ctrl/ and the second without? On the other hand if the makefile is in the same direcetory as those two files, why bother putting the prefix. (I have a premonition that they aren't)
    The next thing is that "${CPP} -c -g ctrl.C" will produce ctrl.o instead Ctrl.o (see the first letter?). As you perhaps know case is important in linux, so add -o Ctrl.o to the ${CPP} commanline.
    "I don't know what I'm running from
    And I don't know where I'm running to
    There's something deep and strange inside of me I see"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •