LIB=/lib

ugrep:		ugrep.o regex.o uio.o
		gcc -nostdlib -s -o ugrep uio.o regex.o ugrep.o $(LIB)/dietstart.o $(LIB)/libdietc.a
		strip -R .note -R .comment ugrep
		ln -fs ugrep uegrep
udgrep:		ugrep.o regex.o
		gcc -o udgrep ugrep.o regex.o
ugrep.o:	ugrep.c
		gcc -g -Wall -Os -c ugrep.c
regex.o:	regex.c regex.h
		gcc -g -Wall -Os -c regex.c
uio.o:		uio.c uio.h
		gcc -g -Wall -Os -c uio.c
clean:	
		rm -f ugrep uegrep udgrep *.o
tarball:
		cd .. && tar cvvIf ugrep.tar.bz2 ugrep
test:		ugrep
		./testrun
