# Makefile template for use under OS/2
#
# libmikmod subdirectory

DRIVER_OBJ=@DRIVER_OBJ@

AR=@AR@
ARFLAGS=@ARFLAGS@
CC=@CC@
CFLAGS=@CFLAGS@
COMPILE=$(CC) $(CFLAGS) -I../include -I..
IMPLIB=@IMPLIB@

.SUFFIXES:
.SUFFIXES: .o .c

LIBS=@LIBS@
LIBNAME=@LIBNAME@
DLLNAME=@DLLNAME@
DEFNAME=@DEFNAME@
OBJ=$(DRIVER_OBJ) \
    drv_nos.o drv_raw.o drv_stdout.o drv_wav.o \
    load_669.o load_amf.o load_dsm.o load_far.o load_gdm.o load_it.o  \
    load_imf.o load_m15.o load_med.o load_mod.o load_mtm.o load_s3m.o \
    load_stm.o load_stx.o load_ult.o load_uni.o load_xm.o \
    mmalloc.o mmerror.o mmio.o \
    mdriver.o mdreg.o mloader.o mlreg.o mlutil.o mplayer.o munitrk.o mwav.o \
    npertab.o sloader.o virtch.o virtch2.o virtch_common.o

all:		@LIB@

clean:		FORCE
	FOR %F IN ( $(LIBNAME) $(DLLNAME) $(OBJ) ) DO IF EXIST %F ERASE %F

distclean:	clean
	FOR %F IN ( $(DEFNAME) ..\include\mikmod.h ..\include\mikmod_build.h Makefile ) DO IF EXIST %F ERASE %F

$(DLLNAME): $(OBJ) $(DEFNAME)
	$(CC) $(CFLAGS) -Zso -Zsys -o $(DLLNAME) $(DEFNAME) $(OBJ) $(LIBS)
	$(IMPLIB) -o $(LIBNAME) $(DEFNAME)

$(LIBNAME):	$(OBJ)
	$(AR) $(ARFLAGS) $(LIBNAME) $(OBJ)

drv_dart.o:	../drivers/drv_dart.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../drivers/drv_dart.c
drv_nos.o:	../drivers/drv_nos.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../drivers/drv_nos.c
drv_os2.o:	../drivers/drv_os2.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../drivers/drv_os2.c
drv_raw.o:	../drivers/drv_raw.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../drivers/drv_raw.c
drv_stdout.o:	../drivers/drv_stdout.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../drivers/drv_stdout.c
drv_wav.o:	../drivers/drv_wav.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../drivers/drv_wav.c
load_669.o:	../loaders/load_669.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_669.c
load_amf.o:	../loaders/load_amf.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_amf.c
load_dsm.o:	../loaders/load_dsm.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_dsm.c
load_far.o:	../loaders/load_far.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_far.c
load_gdm.o:	../loaders/load_gdm.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_gdm.c
load_it.o:	../loaders/load_it.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_it.c
load_imf.o:	../loaders/load_imf.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_imf.c
load_m15.o:	../loaders/load_m15.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_m15.c
load_med.o:	../loaders/load_med.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_med.c
load_mod.o:	../loaders/load_mod.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_mod.c
load_mtm.o:	../loaders/load_mtm.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_mtm.c
load_s3m.o:	../loaders/load_s3m.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_s3m.c
load_stm.o:	../loaders/load_stm.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_stm.c
load_stx.o:	../loaders/load_stx.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_stx.c
load_ult.o:	../loaders/load_ult.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_ult.c
load_uni.o:	../loaders/load_uni.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_uni.c
load_xm.o:	../loaders/load_xm.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../loaders/load_xm.c
mmalloc.o:	../mmio/mmalloc.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../mmio/mmalloc.c
mmerror.o:	../mmio/mmerror.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../mmio/mmerror.c
mmio.o:		../mmio/mmio.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../mmio/mmio.c
mdriver.o:	../playercode/mdriver.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/mdriver.c
mdreg.o:	../playercode/mdreg.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/mdreg.c
mloader.o:	../playercode/mloader.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/mloader.c
mlreg.o:	../playercode/mlreg.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/mlreg.c
mlutil.o:	../playercode/mlutil.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/mlutil.c
mplayer.o:	../playercode/mplayer.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/mplayer.c
munitrk.o:	../playercode/munitrk.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/munitrk.c
mwav.o:		../playercode/mwav.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/mwav.c
npertab.o:	../playercode/npertab.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/npertab.c
sloader.o:	../playercode/sloader.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/sloader.c
virtch.o:	../playercode/virtch.c ../playercode/virtch_common.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/virtch.c
virtch2.o:	../playercode/virtch2.c ../playercode/virtch_common.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/virtch2.c
virtch_common.o:	../playercode/virtch_common.c \
			../include/mikmod_build.h ../include/mikmod_internals.h
	$(COMPILE) @ORULE@ ../playercode/virtch_common.c

FORCE:
