CC=i586-mingw32msvc-gcc
CFLAGS=-O3 -Iinc/ -Wall
LDFLAGS=-lpng -lz -lvfw32 -Llib/
OBJS=avs2bdnxml.o auto_split.o palletize.o
EXE=avs2bdnxml.exe

%.o: %.c
	$(CC) -c $< $(CFLAGS)

$(EXE): $(OBJS)
	$(CC) -o $(EXE) $(OBJS) $(LDFLAGS)

all: $(EXE)

dist: clean all
	strip -s $(EXE)
	upx-ucl --best $(EXE)
	rm -f $(OBJS)

.phony clean:
	rm -f $(EXE) $(OBJS)

