#   Kalender version 2.0  Copyright (C) 1998-2004 Frank Reglin
#
#   Kalender is free software; you can redistribute it and/or modify it
#   under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2, or (at your option)
#   any later version.
#
#   Kalender is distributed in the hope that it will be useful, but
#   WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#   See the GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with Kalender; see the file COPYING.

# nmake 

# ########## system dependend macros:

!ifdef __OS2__
#   GNU C 2.7.2.1 for os/2 

OBJ=obj
LIB=lib
EXE=.exe

WARNINGS=-Wall -Wcast-align -Wmissing-prototypes

CFLAGS= -O2 -s $(WARNINGS) -Zomf -D__OS2__
LFLAGS= -s -Zomf -Zsys -Zstack 8000 -Zlinker /PM:PM

BIN   = binos2
OBJDIR= objos2
CC    = gcc $(CFLAGS) -c -o $@ $(*F).c
LINK  = gcc $(LFLAGS) -o $@
RC    = rc -r -d__OS2__ $(*F).rc $@
RC2   = rc $(OBJDIR)\$(*F).res $@

!endif

!ifdef __WIN32__
#   MS Visual C 5.00 for Win32

OBJ=obj
LIB=lib
EXE=.exe

CFLAGS= /c /ML /W3 /WX /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "__WIN32__"
LFLAGS= /incremental:no /nodefaultlib /MACHINE:IX86 /LIBPATH:"$(LIB)"

BIN   = binwin
OBJDIR= objwin
CC    = cl   $(CFLAGS) /Fo$@ $(*F).c
LINK  = link $(LFLAGS) /out:$@ $(OBJDIR)\$(*F).res
RC    = rc /D__WIN32__ /fo$@ $(*F).rc 
RC2   = @rem

LIBS  = libc.lib kernel32.lib user32.lib

!endif

# ########### goals: ###########################################

$(BIN)\kalender.exe: $(OBJDIR)\kalender.obj $(OBJDIR)\kalender.res
   $(LINK) $(OBJDIR)\kalender.obj $(LIBS)
   $(RC2)

$(OBJDIR)\kalender.obj: kalender.c kalender.h
   $(CC)

$(OBJDIR)\kalender.res: kalender.rc kalender.h
   $(RC)


