
CPPFLAGS+= -Wall

CPPFLAGS+= -O3

PREFIX=/usr/local/

all: cgi.o testcgi.cgi

install: cgi.o cgi.h
	cp cgi.o $(PREFIX)/lib
	cp cgi.h $(PREFIX)/include

cgi.o: cgi.cc cgi.h
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@

testcgi.o: testcgi.cc cgi.h
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@

testcgi.cgi: testcgi.o cgi.o
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@

clean:
	rm -f *.o *~

clear: clean
	rm -f testcgi.cgi
