BINUTILS  = ../../binutils-2.20.1
LIBIBERTY = $(BINUTILS)/libiberty
BIN       = ~/bin

WARN_CFLAGS = -W -Wall -Wstrict-prototypes -Wmissing-prototypes

CFLAGS  = -g -I. -I$(BINUTILS)/include $(WARN_CFLAGS)

OBJECTS = \
 cx.o 

LIBRARIES = \
 $(LIBIBERTY)/libiberty.a

cx : $(OBJECTS) main.o
	gcc -o cx -g $(CFLAGS) $(OBJECTS) main.o $(LIBRARIES)

main.o : main.c
	gcc -c $(CFLAGS) main.c

cx.o : cx.c
	gcc -c $(CFLAGS) cx.c

tests : test1

test1 :
	./cx -g -I.. -I../binutils-2.16.1/include ../asx.cpp > asx.cx

install: cx
	cp cx $(BIN)/cx
	chmod 755 $(BIN)/cx

clean :
	rm *.o
