Source

daybodep / Makefile.bor

Full commit
#
#   Daybo Logic Dependency tool
#   Copyright (C) 2001-2005  David Duncan Ross Palmer, Daybo Logic.
#
#   This program 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 of the License, or
#   (at your option) any later version.
#
#   This program 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 this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
# Daybo Logic,
# Flat 2 Barker Court,
# Victoria Avenue,
# Redfield,
# Bristol
# United Kingdom
#
# BS5 9NW
#
#
# Makefile for Borland C++ (define B16 to force 16-bit compile) otherwise
# 32-bit mode is used by default.  If you are using another compiler
# such as Turbo C++, in which CC is defined to point to 'tcc', define
# BDEF to build with defaults.
#

!ifdef OVERCHAT
!include ../MasterMake.bor
!endif

C=.c
CPP=.cpp
H=.h
O=.obj
E=.exe
NULL_DEVICE=nul
ERASE=erase

FILES=daybodep$(C) \
      ddstderr$(C) \
      dstrlist$(C) \
      checksum$(C) \
      strsimp$(C) \
      ddtokens$(C) \
      license$(C)

OBJS=daybodep$(O) \
     ddstderr$(O) \
     dstrlist$(O) \
     checksum$(O) \
     strsimp$(O) \
     ddtokens$(O) \
     license$(O)

MYLIBS=

!ifdef DEBUG
CFLAGS=-DDEBUG -D__WIN32__ -v -c -A
LFLAGS=-DDEBUG -D__WIN32__ -v
!else
CFLAGS=-DNDEBUG -D__WIN32__ -O1 -c -A
LFLAGS=-DNDEBUG -D__WIN32__ -O1
!endif

TARGET=daybodep$(E)

!ifndef BDEF
!ifdef B16
CC=bcc
!else
CC=bcc32
!endif
!endif

all : $(TARGET)
	-upx -v -9 $(TARGET)
	-upx -t $(TARGET)
	-upx32 -v -9 $(TARGET)
	-upx32 -t $(TARGET)

$(TARGET) : $(OBJS)
	call doslink.bat $(CC) $(LFLAGS) -e$(TARGET)

daybodep$(O) : daybodep$(C) daybodep$(H)
	$(CC) $(CFLAGS) daybodep$(C)

ddstderr$(O) : ddstderr$(C) daybodep$(H)
	$(CC) $(CFLAGS) ddstderr$(C)

dstrlist$(O) : dstrlist$(C) daybodep$(H)
	$(CC) $(CFLAGS) dstrlist$(C)

checksum$(O) : checksum$(C) daybodep$(H)
	$(CC) $(CFLAGS) checksum$(C)

strsimp$(O) : strsimp$(C) daybodep$(H)
	$(CC) $(CFLAGS) strsimp$(C)

ddtokens$(O) : ddtokens$(C) daybodep$(H)
	$(CC) $(CFLAGS) ddtokens$(C)

license$(O) : license$(C) daybodep$(H)
	$(CC) $(CFLAGS) license$(C)

clean:
	@echo "==> Clean daybodep <=="
	-@if exist daybodep$(O) $(ERASE) daybodep$(O)
	-@if exist ddstderr$(O) $(ERASE) ddstderr$(O)
	-@if exist dstrlist$(O) $(ERASE) dstrlist$(O)
	-@if exist checksum$(O) $(ERASE) checksum$(O)
	-@if exist strsimp$(O) $(ERASE) strsimp$(O)
	-@if exist ddtokens$(O) $(ERASE) ddtokens$(O)
	-@if exist license$(O) $(ERASE) license$(O)
	-@if exist daybodep.tds $(ERASE) daybodep.tds
	-@if exist *.bak $(ERASE) *.bak
	-@if exist daybodep.il? $(ERASE) daybodep.il?
	-@if exist $(TARGET) $(ERASE) $(TARGET)

test : all
	rem Test the license is NULL terminated
	$(TARGET) --license > $(NULL_DEVICE)
	$(TARGET) --version
	dir $(TARGET)