#
# Makefile for ENEE 350
#

#
# you may modify the following lines:
#  EXEC  is the executable name
#  SRCS  is a list of C files that are used to build the executable
#  HDRS  is a list of header files for the C files
#  EXTRA is a list of additional files (not .c or .h files) to be submitted

EXEC_1 = assembler
SRCS_1 = assembler.c
HDRS_1 = 

EXEC_2 = simulator
SRCS_2 = simulator.c
HDRS_2 = 

EXTRA = mult.s 

##########################################################
# you should not need to modify anything below this line #
##########################################################

OBJS_1 = $(SRCS_1:.c=.o)
OBJS_2 = $(SRCS_2:.c=.o)

EXEC = $(EXEC_1) $(EXEC_2)
SRCS = $(SRCS_1) $(SRCS_2)
HDRS = $(HDRS_1) $(HDRS_2)
OBJS = $(OBJS_1) $(OBJS_2)

SUBMIT = $(SRCS) $(HDRS) Makefile $(EXTRA)

CC = gcc
LIBS = -lm

all:	$(EXEC)

$(EXEC_1):	$(OBJS_1) $(HDRS_1)
	$(CC) $(LIBS) -o $(EXEC_1) $(OBJS_1)

$(EXEC_2):	$(OBJS_2) $(HDRS_2)
	$(CC) $(LIBS) -o $(EXEC_2) $(OBJS_2)

submit:	$(EXEC)
	tar -cf - $(SUBMIT) | compress | uuencode `whoami`.tar.Z | Mail -s "_ENEE350H_submission_" blj@eng.umd.edu 

lint:
	lint $(SRCS) > lint.out

ctags:	$(SRCS)
	ctags $(SRCS) $(HDRS)

clean:
	rm -f $(OBJS) $(EXEC)

