Thread: make only does the first line

  1. #16
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    You didn't answer my questions... I can't guide you if you don't help me

    >>so a file that is not in a dir is not seen as being updated?
    I am going to presume that you are seeing what I described in my last post. In which case, think of this:

    make requires parameters. If you don't give it any, it will take a stab a guessing what you want it to do, if that isn't correct, you need to do something else.

    Add the "all" rule like I've said (3 times now )
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  2. #17
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    Add the "all" rule like I've said
    i guess your right, i was hoping for quick fix. right now i have some rules setup, can i call them like functions?

    thanks

  3. #18
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    i tried using this for my all rule

    Code:
    .PHONY : all
    all:
    	str_remove.o
    	str_replace.o
    	str_copy.o
    	str_count.o
    	str_insert.o
    	str_move.o
    when i run "make all" i get "make: Nothing to be done for `all'." nothing was made(.o's or .A's).

    <edit>
    i now get
    str_remove.o
    process_begin: CreateProcess(I:\libraries\strings\str_remove.o, str_remove.o, .
    .) failed.
    make (e=193): Error 193make: *** [all] Error 193
    </edit>
    Last edited by mart_man00; 06-20-2003 at 11:41 PM.

  4. #19
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Code:
    all: 	str_remove.o \
     	str_replace.o \
     	str_copy.o \
    	str_count.o \
    	str_insert.o \
    	str_move.o
    Then use "make all" as the command to make it all happen.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #20
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    Code:
    I:\libraries\strings>make all
    str_remove.o \
    str_replace.o \
    str_copy.o \
    str_count.o \
    str_insert.o \
    str_move.o
    process_begin: CreateProcess((null), str_remove.o str_replace.o str_copy.o str_c
    ount.o str_insert.o str_move.o, ...) failed.
    make (e=2): The system cannot find the file specified.
    make: *** [all] Error 2

    they all work fine on their own

    <edit>
    i didnt put it on the same line! it works now. thanks.
    </edit>

  6. #21
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    i get "Entering directory `/home/martin/libraries/strings'" a few undred times back when i run make all and then it tell me error 2 with strings.o.

    this is really bugging me now...

    Code:
    str_remove.o : str_remove.c
    	gcc -c str_remove.c
    	ar -cr str_remove.a
    	ranlib str_remove.a
    str_replace.o : str_replace.c
    	gcc -c str_replace.c
    	ar -cr str_replace.a 
    	ranlib str_replace.a
    str_copy.o : str_copy.c
    	gcc -c str_copy.c
    	ar -cr str_copy.a 
    	ranlib str_copy.a
    str_count.o : str_count.c
    	gcc -c str_count.c
    	ar -cr str_count.a 
    	ranlib str_count.a
    str_insert.o : str_insert.c
    	gcc -c str_insert.c
    	ar -cr str_insert.a 
    	ranlib str_insert.a
    str_move.o : str_move.c str_remove.c str_insert.c
    	gcc -c str_move.c str_remove.c str_insert.c
    	ar -cr str_move.a 
    	ranlib str_move.a
    strings.o : str_remove.o str_replace.o str_copy.o str_move.o str_count.o str_insert.o
    	make all
    	ld -r -o strings.o str_remove.o str_replace.o str_copy.o str_move.o str_count.o str_insert.o
    	ar -cr strings.a
    	ranlib strings.a
    .PHONY: all clean
    all:	str_remove.o \
    	str_replace.o \
    	str_copy.o \
    	str_count.o \
    	str_insert.o \
    	str_move.o \
    	strings.o
    clean:
    	rm *.o
    	rm *.a

  7. #22
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    This seems recursive to me
    lol, there we go, my screw up!

    What's with all the empty libraries (again)
    what do you mean? i see file sizes for what i think are libraries. im using what i found in a book(except for the -c flag, i found that in a thread here. the man page made me think i should have it).

  8. #23
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    about the recursive problem, i dont see a way around it(that seems right). the files need to be there to be linked and make all should do evereything. shouldnt one stop when theres nothing todo?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help again with scrolling without wrapping
    By Dukefrukem in forum C Programming
    Replies: 8
    Last Post: 09-21-2007, 12:48 PM
  2. makefile
    By twans in forum C++ Programming
    Replies: 3
    Last Post: 04-08-2005, 12:16 AM
  3. print line by line from a file
    By SoFarAway in forum C Programming
    Replies: 3
    Last Post: 02-18-2005, 01:36 PM
  4. SSCANF help
    By mattz in forum C Programming
    Replies: 7
    Last Post: 12-10-2001, 04:53 PM
  5. Validating the contents of a char buffer
    By mattz in forum C Programming
    Replies: 3
    Last Post: 12-09-2001, 06:21 PM