#*************************************************************************
#*
#* McGill University, School of Computer Science 
#*
#* Project: simple Makefile example 
#* Filename: Makefile
#* Language: Makefile 
#* Author: HV 
#* Locker: 
#* Date: 
#* Revision history: 
#* State: 
#*
#*************************************************************************

#* Macros ****************************************************************

CC=gcc                             # use the GNU C compiler
CFLAGS=-g -Wall -ansi -pedantic    # -g   : include info for debugger 
                                   # -Wall: maximum warning level
				   # -ansi: demand ANSI C
				   # -pedandic: reject non-ANSI programs 
RM=/bin/rm -f                      # remove, don't complain if not found 

#* Targets ****************************************************************

all: target1 target2 

target1: target1.o common.o
	$(CC) $(CFLAGS) -o target1 target1.o common.o

target2: target2.o common.o
	$(CC) $(CFLAGS) -o target2 target2.o common.o

target1.o: target1.c common.h
	$(CC) $(CFLAGS) -c target1.c

target2.o: target2.c common.h
	$(CC) $(CFLAGS) -c target2.c

common.o: common.c common.h
	$(CC) $(CFLAGS) -c common.c

clean:
	$(RM) *.o

clean_target: clean
	$(RM) target1 target2

# End of file Makefile 
