include ../../Makefile.inc
RM = rm


# Doesn't compile zlib into fex.a since most systems have a native version already.
# To enable RAR support, edit blargg_config.h.

all: libfex.a

libfex.a: fex/fex.h fex/blargg_config.h
	cd   fex;$(CXX) -I.. -c -ffunction-sections -fdata-sections -Os -fno-rtti -fno-exceptions *.cpp
	cd unrar;$(CXX)      -c -ffunction-sections -fdata-sections -Os -fno-rtti -fno-exceptions *.cpp
	cd  7z_C;$(CC)       -c -ffunction-sections -fdata-sections -Os *.c
	$(AR) $(ARFLAGS) libfex.a fex/*.o unrar/*.o 7z_C/*.o
	-$(RANLIB) libfex.a
	mv libfex.a ../../libs

clean:
	-$(RM) libfex.a fex/*.o unrar/*.o 7z_C/*.o
