#-*- Makefile -*-
include ../../gnuwin32/MkRules

CPPFLAGS =-I../../include -I. -Iapi -DLZMA_API_STATIC -DHAVE_CONFIG_H -DWIN32

SOURCES = \
 alone_decoder.c alone_encoder.c arm.c armthumb.c auto_decoder.c \
 block_buffer_decoder.c block_buffer_encoder.c block_decoder.c \
 block_encoder.c block_header_decoder.c block_header_encoder.c block_util.c \
 check.c common.c crc32_table.c \
 crc64_table.c delta_common.c delta_decoder.c \
 delta_encoder.c easy_buffer_encoder.c easy_decoder_memusage.c easy_encoder.c \
 easy_encoder_memusage.c easy_preset.c fastpos_table.c \
 filter_buffer_decoder.c filter_buffer_encoder.c filter_common.c \
 filter_decoder.c filter_encoder.c filter_flags_decoder.c \
 filter_flags_encoder.c ia64.c index.c index_decoder.c index_encoder.c \
 index_hash.c lz_decoder.c lz_encoder.c lz_encoder_mf.c lzma2_decoder.c \
 lzma2_encoder.c lzma_decoder.c lzma_encoder.c lzma_encoder_optimum_fast.c \
 lzma_encoder_optimum_normal.c lzma_encoder_presets.c powerpc.c \
 price_table.c sha256.c simple_coder.c simple_decoder.c \
 simple_encoder.c sparc.c stream_buffer_decoder.c stream_buffer_encoder.c \
 stream_decoder.c stream_encoder.c stream_flags_common.c \
 stream_flags_decoder.c stream_flags_encoder.c \
 vli_decoder.c vli_encoder.c vli_size.c x86.c


## Use assembler version on i386
ifeq "$(WIN)" "64"
OBJECTS = $(SOURCES:.c=.o) crc32_fast.o crc64_fast.o
else
OBJECTS = $(SOURCES:.c=.o) crc32_x86.o crc64_x86.o
endif

all:
	@$(MAKE) -f Makefile.win stamp
	@$(MAKE) -f Makefile.win liblzma.a

stamp:
	@cp -p */*.c */*.h check/*.S .
	touch stamp

liblzma.a: $(OBJECTS)

clean:
	@$(RM) -f Makedeps stamp *.c *.h *.o *.S
distclean: clean
	@$(RM) liblzma.a
