# Makefile
#   
# Computer Sys.Organization II
# Spring, 2005.  Prof.Yap
#
# This sample make file will document what is needed
# in this directory!
#
# 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=fork
p=forks
p=forkss
p=test

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

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