CC = gcc
OPTIONS = -O6

all:	objects shared static

objects:
	$(CC) $(OPTIONS) -c iostream.cc -o iostream.o -I../cppinc/ -I../cinc/

shared:
	$(CC) $(OPTIONS) -shared -Wl,-soname,libC++.so.1 -o libC++.so.1.0 iostream.o gc.a

static:
	cp libC++.so.1.0 libC++.a

install:	all
	cp libC++.a /usr/local/lib
	cp libC++.so.1.0 /usr/local/lib
	ln -s /usr/local/lib/libC++.so.1.0 /usr/local/lib/libC++.so
	ln -s /usr/local/lib/libC++.so.1.0 /usr/local/lib/libC++.so.1
	mkdir /usr/local/include/c++
	cp ../cppinc/* /usr/local/include/c++
	cp ../cinc/* /usr/local/include/c++

clean:
	rm -f libC++.a libC++.so.1.0
	rm -f /usr/local/lib/libC++.so /usr/local/lib/libC++.a /usr/local/lib/libC++.so.1 /usr/local/lib/libC++.so.1.0
	rm -f -r /usr/local/include/c++
