Thread: makefile problem..

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    46

    makefile problem..

    Hi..

    I'm programming c-code and all methods is working fine.. Then I would like to include headers and global values which should be possible to be edited through every existing file.. But when I include one of my files in the makefile it says:
    # make
    ---> make: Circular staff.o <- staff.o dependency dropped.
    ---> make: `edit' is up to date.
    The makefile looks like this

    objects = main.o drive.o staff.o

    edit : $(objects)
    cc -lm -o edit $(objects)

    main.o : global.h
    drive.o : drive.h global.h
    staff.o : staff.o global.h


    .PHONY: clean
    clean :
    rm edit $(objects)
    The staff.h looks like this..
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

    #ifndef STAFF_H
    #define STAFF_H

    // Staff.c
    char *find_staffmember (char *, char[], int);
    //char *appendchar(char *, size_t, char);
    int staff_update(char[], char[], char[]);

    #endif
    If anybody know what might be the problem, please write..

    - Danny

  2. #2
    Registered User
    Join Date
    May 2007
    Posts
    46
    Never mind.. Have found the problem... I'm just a fool.. Stupid me.. Watch whats wrong:
    Objects = main.o drive.o staff.o

    edit : $(objects)
    cc -lm -o edit $(objects)

    main.o : global.h
    drive.o : drive.h global.h
    staff.o : staff.o global.h


    .PHONY: clean
    clean :
    rm edit $(objects)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. problem with Makefile separator
    By luca in forum Tech Board
    Replies: 6
    Last Post: 01-15-2007, 10:20 AM
  3. Problem with makefile, how to use the -lm oh this?
    By Nazgulled in forum C Programming
    Replies: 1
    Last Post: 04-07-2006, 01:29 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  5. Replies: 5
    Last Post: 11-07-2005, 11:34 PM