# Makefile
# Peter Windridge 2001.
# http://www.incomplete.co.uk/

# remember to define borland when using the free compiler!

PROJ = nsisdd
OUTFILE = $(PROJ).exe
SRC = main.OBJ

RES = resource.res

!ifdef borland
# link = ILINK32 /x /aa c0w32.obj $(SRC), $(OUTFILE), , IMPORT32.LIB cw32.lib, , $(RES)
link = ILINK32 /x /aa crt.obj $(SRC), $(OUTFILE), , IMPORT32.LIB, , $(RES)
cl = BCC32 -c -o
rc = brcc32
!else
link = link $(SRC) kernel32.lib user32.lib gdi32.lib shell32.lib \
advapi32.lib comdlg32.lib winspool.lib comctl32.lib ole32.lib \
oleaut32.lib uuid.lib version.lib $(RES) /out:$(OUTFILE) \
/entry:"WinMain"
cl = cl -c -Fo
rc = rc
!endif

# Inference Rules:

.c.obj:
  echo compiling $?..
  $(cl)$@ $?

.rc.res:
  $(rc) $?

$(OUTFILE): $(SRC:.C=.OBJ) $(RES)
  echo linking ...
  $(link)
