PLUG, May 07, 2003    Back

We had our first look at the Linux From Scratch project. First url was http://homepage.ntlworld.com/zarniwhoop/. There we found a link to "Linux from scratch book" (PDF), whose TOC had a link to "Prerequisites." There we found a link to Software-Building-HOWTO.

The first Prerequisite we examined was "make." We wrote a sample Makefile and sample files. SGI doesn't have a working gcc, so we needed to cheat a bit. When you run the makefile, it looks as if the program is being compiled.

Source files are test.c, test2.c ja test3.c. In addition, there is an include file test.h. Below are links to the files.


Makefile
test.h
test.c
test2.c
test3.c

make looks at the files' modified timestamps to determine which files need compiling. The following test works:

make
touch test.h
make

The following output is produced:
sgi# make
gcc -o test.o test.c
gcc -o test2.o test2.c
gcc -o test3.o test3.c
gcc -o test test.o test2.o test3.o


sgi# touch test.h
sgi# make
gcc -o test2.o test2.c
gcc -o test3.o test3.c
gcc -o test test.o test2.o test3.o

Check it out yourself and come to the meeting with your questions. Those present at the meeting seemed to get the hang of make.