![]() |
![]() |
#1 |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Make file questions
I have observed some anomalies in my make files so I am trying to replicate the problems in smaller problems to understand what I am doing wrong.
The first problem I have is that when I do a change make will build the object file but does not recompile the executable. So I have created a simple project with just a main.c which prints hello world and this is my make file; Code:
CC=vc +aos68k COPT = LIBS = -lamiga -lauto all: App %.o : %.c vc -c -o $@ $< App : main.o vc $^ -o $@ $(LIBS) clean: -delete main.o APP However I have other make files where the executable is re-built each time and the only difference is I moved the source files in /src and the build files in /build and the executable file in /bin. Just doing one of these does not seem to work, it seems the three of them needs to be done for the executable to be re-built. After this change, however, even without any changes the executable is rebuilt each time. Here is the second make file; Code:
CC=vc +aos68k COPT = LIBS = -lamiga -lauto all: folder App folder: -makedir build -makedir bin build/%.o : src/%.c vc -c -o $@ $< App : build/main.o vc $^ -o bin/$@ $(LIBS) clean: -delete build/main.o bin/App Last edited by Sim085; 26 February 2022 at 09:37. |
![]() |
![]() |
#2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,047
|
The first example works perfectly for me. App is rebuilt whenever I change main.c.
Make sure the system clock is running properly. If a new .o file is older than the existing App file, it will not be relinked. This often happens if the source directory is on a NAS server (connected via SMBFS) and the time zone is not set up correctly. Or if the system clock is running too fast and after a reboot time has been set back. Or if there is no RTC and after a reboot the clock has been set back to a very old date. Also make sure that all file names are written with proper case as given in the makefile. Names in makefiles are case sensitive. Finally make sure that dependencies are specified correctly. For example a mistake I often make is main.c: something.h instead of main.o: something.h |
![]() |
![]() |
#3 | |
Registered User
Join Date: Apr 2009
Location: N/A
Posts: 962
|
Good to know the script should be good.
I am using FS-UAE on Mac. Will try the same script on WinUAE when I have access to my Windows machine. Quote:
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trying to make HDF file with PSF3 but it not showing on the Workbench | spannernick | support.WinUAE | 11 | 24 September 2023 18:45 |
How do you make a .info file..? | spannernick | support.Apps | 3 | 21 May 2012 01:33 |
Possible to make a hard-file seem like a CD? | Welshieinnz | support.WinUAE | 5 | 02 August 2008 12:46 |
How do I make an iso file? | nikvest | support.Other | 2 | 08 September 2006 11:35 |
Want to make a CAPS IPF file. How? | TjLaZer | support.Games | 3 | 24 March 2005 13:46 |
|
|