# # Makefile for the minithreads src directory. # CC = /usr/local/bin/gcc ARCH_CFLAGS = # Below is the machine dependent configuration section. To configure # this Makefile for the platform you are working on, invoke "../configure". # # BEGIN CONFIGURATION # END CONFIGURATION INCLUDE = -I../include LIB = ../lib SRC = minithread_public.c sys.S clock.c minithread.c synch.c queue.c OBJ_PUB = $(LIB)/minithread_public.o $(LIB)/sys.o $(LIB)/clock.o OBJ_MINE = minithread.o synch.o queue.o OBJS = $(OBJ_PUB) $(OBJ_MINE) CFLAGS = -g -ansi $(INCLUDE) $(ARCH_CFLAGS) all: runtester cigarette boundbuf .SUFFIXES: .c # specify how to compile the .c files .c.o: $(CC) $(CFLAGS) $(INCLUDE) -c $< # # A simple test program. # runtester: runtester.o $(OBJS) $(CC) -o runtester $(CFLAGS) $(OBJS) runtester.o # # bounded buffer problem # boundbuf: boundbuf.o $(OBJS) $(CC) $(CFLAGS) -o boundbuf boundbuf.o $(OBJS) # # cigarette-smoker's problem cigarette: cigarette.o $(OBJS) $(CC) $(CFLAGS) -o cigarette cigarette.o $(OBJS) # # Library routines # $(LIB)/minithread_public.o: minithread_public.c $(CC) -c $(CFLAGS) -o $(LIB)/minithread_public.o minithread_public.c $(LIB)/sys.o: sys.S $(CC) -c $(CFLAGS) -o $@ $? $(LIB)/clock.o: clock.c $(CC) -c $(CFLAGS) -o $(LIB)/clock.o clock.c # NOTE: The rules for sys.o is equivalent to the rule for minithread_public, # but is more general. $@ is a macro that is replaced with the target name, # and $? is a macro that is replaced with the names of the dependents # that are out of date. # # Maintenance targets # clean: @rm -f a.out *.o Makefile.bak ../lib/*.o *~ arch/*~ # this will add the file dependencies below, i.e. it modifies this file depend: makedepend -- $(CFLAGS) -- $(INCLUDE) -- $(SRC) runtester.c boundbuf.c cigarette.c # DO NOT DELETE THIS LINE -- make depend depends on it.