P
Paminu
I have the following three files:
link.h
contains my structs and list of functions.
link.c
contains my implementation of the functions
linktest.c
contains my main function that test the program with some values.
If I only make changes in linktest.c there would be no reason to recompile
link.c
The first time I compile the whole program I do:
gcc -c link.c
gcc -o linktest linktest.c tree.o
But when I only edit the linktest.c file there is no reason to run the first
line: "gcc -c link.c"
Is it possible to make that kind of "rule" in a makefile?
I have tried to write the follwoing make file:
treetest: tree.c
gcc link.c -c
gcc -o linktest linktest.c link.o
But this way both the gcc commands gets run each time.
link.h
contains my structs and list of functions.
link.c
contains my implementation of the functions
linktest.c
contains my main function that test the program with some values.
If I only make changes in linktest.c there would be no reason to recompile
link.c
The first time I compile the whole program I do:
gcc -c link.c
gcc -o linktest linktest.c tree.o
But when I only edit the linktest.c file there is no reason to run the first
line: "gcc -c link.c"
Is it possible to make that kind of "rule" in a makefile?
I have tried to write the follwoing make file:
treetest: tree.c
gcc link.c -c
gcc -o linktest linktest.c link.o
But this way both the gcc commands gets run each time.