# Makefile for bmutil
#
# To build this file with debugging information, use:
#
#    NMAKE DEBUG=1
#
#
# If using C6, comment out the line below

# The following line is to be used if you use C7
C7 = 1

all: bmutil.exe 

clean:
    del *.obj
    del *.exe
    del *.pch

OBJS = bmutil.obj colorchg.obj disabled.obj dither.obj

!ifdef C7
LIBS = slibcew libw oldnames commdlg dibapi
!else
LIBS = slibcew libw commdlg dibapi
!endif

!if "$(DEBUG)"=="1"
APP_compile = -c -W3 -Gw -Zipe -Od
APP_link = /CO /NOD /NOE
APP_map = bmutil.map/map/li
!else
APP_compile = -c -W3 -Gw -Zpe -Ox
APP_link = /NOD /NOE
APP_map = 
!endif

.c.obj:
    cl $(APP_compile) $*.c

bmutil.obj: bmutil.c colorchg.h dialogs.h bmutil.h

dither.obj: dither.c dibapi.h

colorchg.obj: colorchg.c colorchg.h

bmutil.res: $*.rc $*.h bmutil.ico dialogs.dlg dialogs.h
     rc -r $*.rc

bmutil.exe: $(OBJS) bmutil.def bmutil.res
     link @<<
         $(APP_link) $(OBJS)
         bmutil.exe
         $(APP_map)/al:16
         $(LIBS)
         bmutil.def
<<
     rc -T $*.res
