

Makefile lab notes


----------------------------------------------------------------------

silly
		explain general format

what_you_want: what you have to have
<TAB>	how you make what you want from what you have	
	


simple
	


	explain compile (-c) vs link (-o)

	explain the compiler flags
		-g   debug
		-Wall  all compiler warnings
		vs
		-o   optimizing

	notice if everything is up to date then it
		won't make
______________________________________________

now lests build up a multi source one

multi-source/makefile.1
	one link - one for the executable (can have makefiles for
		moer than 1 executable too)
	multiple compiles - one for each source file

	notice that main.c depends on main.h as well
		that way if only main.h changes it
		will still recompile

	we put in all the dependencies by had though
	in a complicated project this can be tough
	and if don't get it work can make changes
	that don't get compilked in - ugh

multi-source/makefile.2
	parameterize things - makes it easier to port/change
	
	notice all has no "wha tto do line"

	clean has no "dependencies line"

	can tell it to make something specific
		or will make the first thing
		it finds - in this case "all"

multi-source/makefile.3
	automatic compile .c's
	that is very nice but loose dependencies

multi-source/makefile.4
	try to get dependencies back
	make depend
		produces makefile.depend
	make
		included by makefile.4


________________________________________
Show C vs C++


make -f makefile_c 
./single_main
make -f makefile_c clean


make -f makefile_c++ 
./single_main
make -f makefile_c++ clean
______________________________________________

Makefile.tuinstra


______________________________________________


Show a project in Visual C++ - all this stuff hidden there



______________________________________________

For more info 

man make


_______________________


Next time: add a mention of lint here as well

