Source

daybodep / Makefile.bsd

Full commit
#
#   Daybo Logic Dependency tool
#   Copyright (C) 2001-2003  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,
# 57 Alderwood Parc,
# Penryn,
# Kernow,
# United Kingdom
#
# TR10 8RL

#
# Makefile for BSD compatible environments.
#

C=.c
CPP=.cpp
H=.h
O=.o
E=

ERASE=rm -f

NULL_DEVICE=/dev/null
FILES=daybodep$(C) daybodep_stderr$(C) daybodep_stringlist$(C) daybodep_checksum$(C) daybodep_strsimple$(C) daybodep_license$(C)
OBJS=daybodep$(O) daybodep_stderr$(O) daybodep_stringlist$(O) daybodep_checksum$(O) daybodep_strsimple$(O) daybodep_license$(O)
MYLIBS=

# I can't use CFLAGS from within a CFLAGS definition because GNU Make is
# retarded and Borland make owns it's backside.  So that's why a lot of
# these flags are repeated.

!ifdef DEBUG
CFLAGS=-D__UNIX__ -g -c -ansi -pedantic -Wall
LFLAGS=-D__UNIX__ -g
!else
CFLAGS=-D__UNIX__ -O1 -c -ansi -pedantic -Wall
LFLAGS=-D__UNIX__ -O1
!endif

CPPC=c++
CC=cc


TARGET=daybodep$(E)

all : bmsg $(TARGET)

$(TARGET) : $(OBJS)
	$(CC) $(LFLAGS) -o $(TARGET) $(OBJS)
	size $(TARGET)

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

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

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

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

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

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

bmsg:
	@echo "==> Building daybodep <==="

clean:
	@echo "==> Clean daybodep <=="
	-@$(ERASE) $(TARGET) $(OBJS)

depend:
	@echo "Cannot generate dependencies of self"

test : all
	./$(TARGET) --license > $(NULL_DEVICE)  # Make sure license is terminated with a NULL character
	./$(TARGET) --version

# You need root to do these things, note: not used by OverChat

install : $(TARGET)
	@echo "==> Installing daybodep <===" 
	@cp -v -f $(TARGET) /usr/local/bin

deinstall : uninstall   #Alias

uninstall:
	@echo "===> Uninstalling daybodep <==="
	@$(ERASE) /usr/local/bin/$(TARGET)