# SCCSID = @(#)makefile 13.6 93/07/15
#################################################################################
#
# Makefile to build Resource DLL and Help file for the Toolkit
# Generic Installation Sample
#
#   Generates a dll:
#      CARDINFO.DLL         - DLL containing data about the adapter to be
#                             installed by the Generic Installation DLL
#   Generates a help file:
#      AUDHELP.HLP          - Help file containing help for installing
#                             an Audio adapter
#
#   Optionally generates another dll:
#      MIDIMAP.DLL          - DLL containing a MIDI Map Table
#
#
# Copyright (c) IBM Corporation  1993
# All Rights Reserved
#
#################################################################################

!if  [SET LIB=..\..\lib;%LIB%]                  || \
     [SET INCLUDE=..\..\h;..\..\inc;%INCLUDE%]
!endif

.SUFFIXES: .com .sys .exe .obj .mbj .asm .inc .def .lrf .crf .ref \
           .lst .sym .map .c .h .lib .msg .pro .txt

RCDLL=CARDINFO
RCRES=CARDINFO
HELPFILE=AUDHELP
MIDIDLL=MIDIMAP
MIDIRES=MIDIMAP

#################################
# Definitions for C Compiler
#################################

CC=icc

CFLAGS=  /C+ /Gd- /Ge- /Gm+ /Gs- /Re /J- /Kb- /Ki- /Ms /Sm /Sn /Ss+ /DINCL_32

#################################
# Definitions for linker
#################################
LINK=link386
MAP = mapsym $(RCDLL)
LFLAGS= /batch /map /nod /noe /noi /packcode /packdata /exepack /align:16
LIBS= DDE4MBS.LIB os2386.lib MMPM2.LIB

#########################################
# Definitions for RESOURCE compiler
#########################################
RC  = rc

#########################################
# Definitions for Help Compiler
#########################################
MS386=icc
IPF=ipfc
L=ENU
P=437
C=1

#################################
# Inference Rules
#################################
.c.obj:
        $(CC) $(CFLAGS) /Fo$(<R).obj $(C_LST) $(<R).c

#################################
# Object file lists
#################################

RCOBJS = rcstub.obj

#############################################################################
# Target Descriptions
# If you wish to create a MIDI Map, take the # off the second line below
# and add a # to the beginning of the first line below.
#############################################################################
#all: rc help
all: rc help midimap

##################################
# CARDINFO.DLL Target Descriptions
##################################

rc: $(RCDLL).dll

$(RCDLL).dll:   $(RCOBJS) $(RCRES).rc makefile $(RCDLL).lrf $(RCDLL).def
        $(LINK)  @$(RCDLL).lrf
        $(RC) $(RCRES).rc $(RCDLL).dll
        $(MAP)

$(RCDLL).def: makefile
        @echo Creating file <<$(@B).def
LIBRARY $(RCDLL)
DESCRIPTION 'DLL file containing resources'
STUB 'OS2STUB.EXE'
DATA NONE
<<keep

$(RCDLL).lrf: makefile
        @echo Creating file <<$(@B).lrf
$(RCOBJS)
$(RCDLL).dll
$(RCDLL).map $(LFLAGS)
$(LIBS)
$(RCDLL).def;
<<keep

##################################
# AUDHELP.HLP Target Descriptions
##################################
help: $(HELPFILE).hlp
$(HELPFILE).hlp: $(HELPFILE).itl makefile
        @echo Creating file $@ > con
        $(IPF) $(HELPFILE).itl /l=$(L) /codepage=$(P) /country=$(C)

#############################################################################
# MIDIMAP.DLL Target Descriptions
# Take out the #'s at the beginning of the following lines in order to create
# a MIDIMAP.DLL resource file.
#############################################################################

midimap: $(MIDIDLL).dll

$(MIDIDLL).dll:   $(RCOBJS) $(MIDIRES).rc makefile $(MIDIDLL).lrf $(MIDIDLL).def
        $(LINK)  @$(MIDIDLL).lrf
        $(RC) $(MIDIRES).rc $(MIDIDLL).dll
        $(MAP)

$(MIDIDLL).def: makefile
        @echo Creating file <<$(@B).def
LIBRARY $(MIDIDLL)
DESCRIPTION 'DLL file containing resources'
STUB 'OS2STUB.EXE'
DATA NONE
<<keep

$(MIDIDLL).lrf: makefile
        @echo Creating file <<$(@B).lrf
$(RCOBJS)
$(MIDIDLL).dll
$(MIDIDLL).map $(LFLAGS)
$(LIBS)
$(MIDIDLL).def;
<<keep

