# Makefile
#   
# Operating Systems
# Fall, 2007.  Prof.Yap
#
# This sample make file will document the actions that one 
# take in this directory, and how to do it!
#
# E.g., to compile a particular program,
# you can just type "make" to accept the default
# or you can type "make p=fork" to compile fork.c.

###################################################
# VARIABLES
p=test
p=fork

# possible platforms
ifndef PLATFORM
	PLATFORM=unix
	PLATFORM=cyg
endif

ifeq (${PLATFORM},cyg)
	exec=a.exe
else 
ifeq (${PLATFORM},unix)
	exec=a.out
endif
endif

###################################################
# TARGETS
###################################################

gcc:
	gcc ${p}.c

test:
	${exec}

h1:	h1.c
	gcc -o h1 h1.c
	./h1

###################################################
# HOUSEKEEPING
###################################################
tar:
	tar cvf homework1.tar Makefile \
		test.c fork.c h1.ps

###################################################
# END
###################################################
