## ## Makefile -- for COSC 6377 Term Project ## ## This Makefile is used only to build the support library. ## It will install library and header files under ## ~jsteach/www/cosc6377/proxy/include ## and ~jsteach/www/cosc6377/proxy/lib/`uname -m`. ## ## It will also build a test program which exercises functions ## in the library -- the command line syntax is rather obscure... ## ## This Makefile has GNU-specific stuff in it -- use with gmake! ## SRCS = http.cc init.c match.c exec.c SAMPLE_SRC = sample1.c sample2.c sample2-sig.c pipe.cc OBJS = http.o LOBJS = init.o match.o exec.o EXEC = http SAMPLE_EXEC = sample1 sample2 sample2-sig pipe-test LIBP = libproxy.a ## For Linux, uncomment the following lines and replace the contents ## with the actual location of the library/include files. ## ##ARCH= ARCH= $(shell uname -s)-$(shell uname -r | cut -d. -f1) CS6377= $(shell ypmatch jsteach passwd | cut -d: -f6)/www/cosc6377 PROXY= $(CS6377)/proxy INCDIR= $(PROXY)/include LIBDIR= $(PROXY)/lib/$(ARCH) ## Compiler section ## CC = gcc CXX = g++ CFLAGS = -g -I$(INCDIR) CXXFLAGS= -g -I$(INCDIR) LIBS = $(LIBP) -L$(LIBDIR) -lrx ## The dependencies and executables ## all: $(LIBP) $(EXEC) $(SAMPLE_EXEC) $(EXEC): $(OBJS) $(LIBP); $(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(LIBS) $(LIBP): $(LOBJS); $(AR) cr $@ $(LOBJS); ranlib $@ || true sample1: sample1.c; $(CC) $(CFLAGS) -o sample1 sample1.c sample2: sample2.c; $(CC) $(CFLAGS) -o sample2 sample2.c sample2-sig: sample2-sig.c; $(CC) $(CFLAGS) -o sample2-sig sample2-sig.c pipe-test: pipe.cc; $(CXX) $(CXXFLAGS) -o pipe-test pipe.cc install: $(LIBP); cp $(LIBP) $(LIBDIR) ## Housekeeping stuff ## .PHONY: clean clean:; $(RM) $(OBJS) $(LOBJS) $(EXEC) $(SAMPLE_EXEC) $(LIBP) core