I am having a problem with the make command that comes with AIX 4.3.1.
Specifically, AIX's make seems to be confused by recently modified source
files and will recompile the source files but will not perform the link
step.
I have attached a sample makefile below along with logs obtained when using
this makefile with the make command under AIX 4.3.1 and IRIX 6.x. Under AIX
touching one of the source files and then entering make will cause the
source file to be recompiled but the executable won't be relinked. On the
other hand, under IRIX 6.x (and previous versions) make seems to be smart
enough to recompile and then relink the executable when one of the source
files is modified.
I have tried using both "make all" and "make main" under AIX to force make
to build the executable. Using "make all" usually results is make issuing a
message like
Target "all" is up to date
Using "make main" seems to force make to perform the link command but it
also seems to force make to recompile all of the source files.
Is there something wrong with my makefile, with AIX's make or is the
behavior of make under IRIX nonstandard?
--------
makefile
--------
SRC = main.f sinc.f constants.f
OBJ = main.o sinc.o
CMD = main
all: $(CMD)
main: main.o sinc.o
$(FC) -o main main.o sinc.o
main.o: constants.f main.f
sinc.o: constants.f sinc.f
clean:
rm $(CMD) $(OBJ)
------------------
Log for AIX 4.3.1:
------------------
aix $ make clean
rm main main.o sinc.o
aix $ make
xlf -O -c main.f
** main === End of Compilation 1 ===
1501-510 Compilation successful for file main.f.
xlf -O -c sinc.f
** sinc === End of Compilation 1 ===
1501-510 Compilation successful for file sinc.f.
xlf -o main main.o sinc.o
Target "all" is up to date.
aix $ touch main.f
aix $ make
xlf -O -c main.f
** main === End of Compilation 1 ===
1501-510 Compilation successful for file main.f.
xlf -O -c sinc.f
** sinc === End of Compilation 1 ===
1501-510 Compilation successful for file sinc.f.
Target "all" is up to date.
aix $ touch sinc.f
aix $ make
xlf -O -c main.f
** main === End of Compilation 1 ===
1501-510 Compilation successful for file main.f.
xlf -O -c sinc.f
** sinc === End of Compilation 1 ===
1501-510 Compilation successful for file sinc.f.
Target "all" is up to date.
aix $ touch constants.f
aix $ make
xlf -O -c main.f
** main === End of Compilation 1 ===
1501-510 Compilation successful for file main.f.
xlf -O -c sinc.f
** sinc === End of Compilation 1 ===
1501-510 Compilation successful for file sinc.f.
Target "all" is up to date.
-----------------
Log for IRIX 6.x:
-----------------
irix $ make clean
rm main main.o sinc.o
irix $ make
f77 -O -c main.f
f77 -O -c sinc.f
f77 -o main main.o sinc.o
irix $ touch main.f
irix $ make
f77 -O -c main.f
f77 -o main main.o sinc.o
irix $ touch sinc.f
irix $ make
f77 -O -c sinc.f
f77 -o main main.o sinc.o
irix $ touch constants.f
irix $ make
f77 -O -c main.f
f77 -O -c sinc.f
f77 -o main main.o sinc.o
S. Kawalko