Hi Barry - I've created a makefile based on yours. I think I have it right but what I'm finding is that if I make the executable, run it successfully, then touch the source file to update its time stamp, when I run make again it recreates the object file but does not update the executable. Here is a screen dump showing the results: [jcl@localhost inputDouble]$ ls -lt total 8 -rw-r--r-- 1 jcl jcl 217 Jan 19 14:51 inputDouble.c -rw-r--r-- 1 jcl jcl 530 Jan 19 14:51 makefile [jcl@localhost inputDouble]$ make gcc -g -c -MMD -MP -o inputDouble.o inputDouble.c gcc -o inputDouble inputDouble.o [jcl@localhost inputDouble]$ ls -lt total 44 -rwxr-xr-x 1 jcl jcl 20872 Jan 19 14:56 inputDouble* -rw-r--r-- 1 jcl jcl 29 Jan 19 14:56 inputDouble.d -rw-r--r-- 1 jcl jcl 4104 Jan 19 14:56 inputDouble.o -rw-r--r-- 1 jcl jcl 217 Jan 19 14:51 inputDouble.c -rw-r--r-- 1 jcl jcl 530 Jan 19 14:51 makefile [jcl@localhost inputDouble]$ touch inputDouble.c [jcl@localhost inputDouble]$ ls -lt total 44 -rw-r--r-- 1 jcl jcl 217 Jan 19 14:56 inputDouble.c -rwxr-xr-x 1 jcl jcl 20872 Jan 19 14:56 inputDouble* -rw-r--r-- 1 jcl jcl 29 Jan 19 14:56 inputDouble.d -rw-r--r-- 1 jcl jcl 4104 Jan 19 14:56 inputDouble.o -rw-r--r-- 1 jcl jcl 530 Jan 19 14:51 makefile [jcl@localhost inputDouble]$ make gcc -g -c -MMD -MP -o inputDouble.o inputDouble.c [jcl@localhost inputDouble]$ ls -lt total 44 -rw-r--r-- 1 jcl jcl 29 Jan 19 14:56 inputDouble.d -rw-r--r-- 1 jcl jcl 4104 Jan 19 14:56 inputDouble.o -rw-r--r-- 1 jcl jcl 217 Jan 19 14:56 inputDouble.c -rwxr-xr-x 1 jcl jcl 20872 Jan 19 14:56 inputDouble* -rw-r--r-- 1 jcl jcl 530 Jan 19 14:51 makefile [jcl@localhost inputDouble]$ Here is the makefile: APPNAME = inputDouble CC=gcc CFLAGS= -g OUTPUT_OPTION= -MMD -MP -o $@ SRCS=$(wildcard *.c) OBJS=$(SRCS:.c=.o) DEPS=$(SRCS:.c=.d) -include ${DEPS} $(APPNAME): $(OBJS) $(CC) -o $(APPNAME) $(OBJS) clean: rm -f *.o *.d $(APPNAME) Any suggestions will be much appreciated. - Thanks - Jim
Perhaps the fact that these changes con't naturally follow from the evolution of the code as it grows, which would show better why do we need all these extra tools at all. The simple code that he presented doesn't need them at all, and uses them in a wrong way (e.g. not having the header file included in both source files - the module that implements it, and the module that uses it; while not included in others who don't use it to show that they won't have to be recompiled).
Auto tools is the worst piece of software invented. Unintelligible, extremely hard to debug, and litters your directory was junk. Just use CMake, Meson, hand-written makefiles, or even zig
What a superb lecturer thanking you ever so much and thoroughly enjoyed every minute of your presentation
Thanks for this immensely helpful tutorial to clarify this my most confusing topic!
woah i will try to practice these examples so i can have a good understanding about these automating tools , sounds really helpful!
Great presentation! This is the sort of video I've been looking for
It's really helpful to understand what autotool do. Thanks!
The Best presentation ever made on Autotools and make tool...
Nice presentation. I can't able to access slides for presentation can you check it once
Excellent tutorial. Thanks for sharing it.
Now this is called learning
from theory to practical
This is a really helpful video. Thanks so much for sharing it.
Great one!
Really great demonstration, thank you!
This video refers to all deprecated stuff of GNU toolchains although things been moved much furthers. using autoscan utii can get started.
can you please point me to some actual autotools tutorial? Thanks
Awesome Lecture. Very helpful.
very informative ,thank you so much!
17:04 Generate dependency files.
25:51 Library.
16:08 What is the difference between $(…) and ${…} here?
@ is not called ampersand :P
somebody tell him it's at sign... >
Here where I live, we call it a "monkey" :) Because it looks like a monkey with a very long tail around it ;)
Hi Barry - I've created a makefile based on yours. I think I have it right but what I'm finding is that if I make the executable, run it successfully, then touch the source file to update its time stamp, when I run make again it recreates the object file but does not update the executable. Here is a screen dump showing the results:
[jcl@localhost inputDouble]$ ls -lt
total 8
-rw-r--r-- 1 jcl jcl 217 Jan 19 14:51 inputDouble.c
-rw-r--r-- 1 jcl jcl 530 Jan 19 14:51 makefile
[jcl@localhost inputDouble]$ make
gcc -g -c -MMD -MP -o inputDouble.o inputDouble.c
gcc -o inputDouble inputDouble.o
[jcl@localhost inputDouble]$ ls -lt
total 44
-rwxr-xr-x 1 jcl jcl 20872 Jan 19 14:56 inputDouble*
-rw-r--r-- 1 jcl jcl 29 Jan 19 14:56 inputDouble.d
-rw-r--r-- 1 jcl jcl 4104 Jan 19 14:56 inputDouble.o
-rw-r--r-- 1 jcl jcl 217 Jan 19 14:51 inputDouble.c
-rw-r--r-- 1 jcl jcl 530 Jan 19 14:51 makefile
[jcl@localhost inputDouble]$ touch inputDouble.c
[jcl@localhost inputDouble]$ ls -lt
total 44
-rw-r--r-- 1 jcl jcl 217 Jan 19 14:56 inputDouble.c
-rwxr-xr-x 1 jcl jcl 20872 Jan 19 14:56 inputDouble*
-rw-r--r-- 1 jcl jcl 29 Jan 19 14:56 inputDouble.d
-rw-r--r-- 1 jcl jcl 4104 Jan 19 14:56 inputDouble.o
-rw-r--r-- 1 jcl jcl 530 Jan 19 14:51 makefile
[jcl@localhost inputDouble]$ make
gcc -g -c -MMD -MP -o inputDouble.o inputDouble.c
[jcl@localhost inputDouble]$ ls -lt
total 44
-rw-r--r-- 1 jcl jcl 29 Jan 19 14:56 inputDouble.d
-rw-r--r-- 1 jcl jcl 4104 Jan 19 14:56 inputDouble.o
-rw-r--r-- 1 jcl jcl 217 Jan 19 14:56 inputDouble.c
-rwxr-xr-x 1 jcl jcl 20872 Jan 19 14:56 inputDouble*
-rw-r--r-- 1 jcl jcl 530 Jan 19 14:51 makefile
[jcl@localhost inputDouble]$
Here is the makefile:
APPNAME = inputDouble
CC=gcc
CFLAGS= -g
OUTPUT_OPTION= -MMD -MP -o $@
SRCS=$(wildcard *.c)
OBJS=$(SRCS:.c=.o)
DEPS=$(SRCS:.c=.d)
-include ${DEPS}
$(APPNAME): $(OBJS)
$(CC) -o $(APPNAME) $(OBJS)
clean:
rm -f *.o *.d $(APPNAME)
Any suggestions will be much appreciated. - Thanks - Jim
Don't like the explanation approach...Completely unsystematic.
what do you mean ?
Perhaps the fact that these changes con't naturally follow from the evolution of the code as it grows, which would show better why do we need all these extra tools at all. The simple code that he presented doesn't need them at all, and uses them in a wrong way (e.g. not having the header file included in both source files - the module that implements it, and the module that uses it; while not included in others who don't use it to show that they won't have to be recompiled).
Auto tools is the worst piece of software invented. Unintelligible, extremely hard to debug, and litters your directory was junk. Just use CMake, Meson, hand-written makefiles, or even zig