CFLAGS=-Wall -Werror -O2 -g
CXXFLAGS=$(CFLAGS)
TARGET_ARCH=-m486

# strip symbols, if no debug-info requested
ifneq ($(findstring -g,$(CFLAGS)),-g)
  LDFLAGS+=-s
endif

.PHONY: all clean cleanall
#all:test term
all: libserio.a
	ar rc libserio.a serio.o
	ranlib libserio.a
libserio.a: serio.o
test: test.o serio.o
term: term.o serio.o
test.o: test.c serio.h
term.o: term.c serio.h
serio.o: serio.s
clean:
	rm -f test
	rm -f term
	rm -f *.exe
	rm -f term.o
	rm -f test.o
	rm -f libserio.a
	rm -f serio.o

cleanall: clean
	rm -f serio.o
