CIS307: Mailing Homeworks
For each homework you should create a separate directory
with simple names such as hmw1, hmw2, ....
Suppose that you are doing
homework 3 and you are in directory hmw3. In directory hmw3 you should create
a Makefile so that you can do a recompile by just saying
Once you are satisfied with your homework and ready to send it to the TA, do the following:
The TA, or I, will just have to save the message, and execute the commands:
Here is an example of a Makefile I have used:
OBJS = pqueuepmain.o pqueuep.o queuep.o
TGTS = pqueuepmain
THREAD = -pthread
LIB =
CFLAGS = -g
.SUFFIXES : .o .c .h
${TGTS} : ${OBJS} ${LIB}
${CC} ${CFLAGS} -o $@ ${OBJS} ${LIB} ${THREAD}
.c.o :
${CC} ${CFLAGS} -c $<
.h.c :
${CC} ${CFLAGS} -c $@
clean :
/bin/rm -f core *.o
sclean: # clean away also the targets
/bin/rm -f core *.o ${TGTS}
To use this Makefile in your homeworks you just need to change appropriately OBJS and TGTS to the values right in your case [respectively, the object and image files]. Also, if you are not using threads, you can define THREAD as follows
I am not an expert on "make" so you may come up with a better Makefile.
ingargiola@cis.temple.edu