# mingw32 makefile for mospack
#
# this code depends on IJG's jpeg-6b
# for this to work you need
#   libjpeg.a in mingw\lib
# and
#   jpeglib.h, jmorecfg.h, jerror.h, jconfig.h in mingw\include

# the compiler to use
CC=gcc

# delete command
RM=del
#RM=rm -f

#STRIP=echo
STRIP=strip

# optimization flags
OPT=-O5

# -DDOS for DOS and win32
CFLAGS=-Wall -DDOS $(OPT)
LDFLAGS=-static -ljpeg

# needed for DOS and win32
EXESUFFIX=.exe

APPS=	mospack$(EXESUFFIX) \
	mosunpack$(EXESUFFIX) \
	mozparse$(EXESUFFIX) \
	jpgextract$(EXESUFFIX)


all: $(APPS)

mospack$(EXESUFFIX): mospack.o jpegcompress.o version.o
	$(CC) -o $@ $^ $(LDFLAGS)
	$(STRIP) $@

mosunpack$(EXESUFFIX): mosunpack.o jpeguncompress.o version.o
	$(CC) -o $@ $^ $(LDFLAGS)
	$(STRIP) $@

mozparse$(EXESUFFIX): mozparse.o
	$(CC) -o $@ $^ $(LDFLAGS)
	$(STRIP) $@

jpgextract$(EXESUFFIX): jpgextract.o
	$(CC) -o $@ $^ $(LDFLAGS)
	$(STRIP) $@

clean:
	$(RM) *.o $(APPS)

distclean: clean
	$(RM) Makefile
