Today, 09:31 | #1 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 964
|
Small problem with makefile
I have a small problem with a make file. In summary in this project I am doing a copy of all code in source directory to a temp directory. I then do some place holder text replacements and finally I continue with compilation.
So for example, given /source/main.c, the make file will copy this to /temp/main.c, modify /temp/main.c and then compile from /temp/main.c. However the first time I run the make file it always gives me the error: No match for main.o No objects to link make: **** [Example] error 5 The second time I run the command it then works ok and continues to work until I run "make clean" (which deletes the temp directory). If I compile directly from source directory then the error does not happen. I am working on WinUAE (not sure if on real hardware the error happens or not). Anyone knows of what possible solution there is to resolve this? I can work around it (as second time and following that it compiles) but it is just annoying. |
Today, 11:41 | #2 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 694
|
maybe there is an error in line 127 of your makefile...
... or you should always create the temp folder if it does not exist |
Today, 18:15 | #3 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 964
|
I do have a rule to always create the temp directory, and I can see the temp directory exists and source files have been moved to this.
The issue seems like a timing issue. Here are my rules: Code:
all: dirs copysrc MyApp dirs: -makedir temp -makedir bin copysrc: copy all source/ temp In summary the make file first tries to create the directory, than copy the source to temp and finally it tries to compile the solution. It seems that 'MyApp' is being evaluated before copysrc completes. |
Today, 20:00 | #4 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,495
|
The order is not "timing", the issue is that you seem to imply that the rules are executed in a specific order, but they are not. They only deffine logical dependencies. Thus, "dirs" should probably be "temp", because "make" can check whether "temp" exist, and "copysrc" should explicitly depend on "temp" because it needs the directory to exist to work.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Small FastATA ZIV problem | utri007 | support.Hardware | 1 | 20 July 2021 16:43 |
Small problem with expansions setting page | mark_k | support.WinUAE | 1 | 22 June 2017 12:44 |
small problem with caracteres ?? | Alexfrench | project.ClassicWB | 3 | 04 June 2012 16:37 |
A small problem | clownstyle | New to Emulation or Amiga scene | 1 | 20 January 2004 20:47 |
small problem | pulley | support.Hardware | 2 | 05 November 2002 13:21 |
|
|