# Makefile for the Borland C++ 3.1 Compiler
#
# Support for FileNav from PBLib
# Copyright (C) 1995 by Branislav L. Slantchev
#
# This file is part of FileNav.
#
# FileNav 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; version 2.
#
# FileNav 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 FileNav; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#

#
# Create the offline and online libraries.
#
# Call with 'make' to create the offline version, OFFLINE.LIB
# Call with 'make -DPB_SDK' to create the ProBoard version, PROBOARD.LIB
#
!include "common.def"

#
# define this for any custom libraries
#
# CUSTOMLIBS

#
# Set up the startup code object file and the default libraries
#
CFLAGS = $(CFLAGS) -I$(PBINC);c:\cc\inc

#
# set up the macros for EXE or PEX version
#
!if $d(PB_SDK)
TARGET = proboard
!else
TARGET = offline
!endif

#
# List all object files required for the program
#
OBJ_depend = \
	getopt.obj	  \
    xkeys.obj	  \
    isaccess.obj  \
    strnecpy.obj  \
    gdlist.obj	  \
    timer.obj	  \
    chext.obj	  \
    userd.obj	  \
    memdbg.obj	  \
    inifile.obj	  \
    tmpname.obj	  \
    basedir.obj	  \
    stristr.obj

#
# This is the main line, the file is made here
#
$(TARGET).lib: clean $(OBJ_depend) filenav.lls
	$(LIB) $< @filenav.lls

#
# for each object file, list its source dependent, if source is in
# different directory, use $(CC) $(CFLAGS) <sourcepath> as action line
# otherwise, leave the action line empty
#
getopt.obj  : getopt.c
xkeys.obj   : xkeys.c
isaccess.obj: isaccess.c
strnecpy.obj: strnecpy.c
gdlist.obj	: gdlist.c
timer.obj	: timer.c
chext.obj	: chext.c
userd.obj	: userd.c
memdbg.obj	: memdbg.c
inifile.obj	: inifile.c
tmpname.obj	: tmpname.c
basedir.obj	: basedir.c
stristr.obj : stristr.c

#
# Create the TLIB response file
#
filenav.lls: makefile
	copy &&|
+getopt.obj	  &
+xkeys.obj	  &
+isaccess.obj &
+strnecpy.obj &
+gdlist.obj	  &
+timer.obj	  &
+chext.obj	  &
+userd.obj	  &
+memdbg.obj	  &
+inifile.obj  &
+tmpname.obj  &
+basedir.obj  &
+stristr.obj
| filenav.lls

#
# clean up all intermediary files
#
clean:
    - rm *.obj *.lls

cleanall:
	- rm *.obj *.lls *.lib
