# *******************************************************************
# *     Copyright (c) 1994-2008 Jetico, Inc., Finland
# *     All rights reserved.
# *
# *     File:           Makefile
# *
# *     Description:    bcwipe makefile
# *
# *     Scope:          BestCrypt Wipe utility
# *
# *     Platforms:      Unix
# *
# *     Author:         Vitaliy Zolotarev
# *
# *     Revision:       $Id: Makefile,v 1.15 2007-09-11 03:24:58 pav Exp $
# *
# *******************************************************************/

MAN_PATH   = $(shell ./man_path)

#
# Operation system name.
#  Following string automatically detects operation system name
# Note.
#  The syntax works perfectly for 'gmake' and for almost all native 'make'.
#  If the value at CFLAG is empty it may be redefined manally, 
#   for example:
#	OS_NAME = AIX
#	OS_NAME = HP_UX
#	OS_NAME = Linux
#  You may set the varable directly in the Makefile or send it as parameter
#  to make compiler,
#   for example:
#	> make bcwipe OS_NAME=AIX
#

OS_NAME = $(shell uname -s |tr "-" "_" )

#
# Compilator
#  Default compiler is native cc. You may redefine the value 
#  You may set the varable directly in the Makefile or send it as parameter
#  to make compiler,
#   for example:
#	> make bcwipe CC=gcc
#
#CC = gcc

INSTALL = install

CFLAGS = -O -DOS_$(OS_NAME) -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE #-static -Wall -Werror  

#CFLAGS = -O -DOS_`uname -s |tr "-" "_"` -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE #-static -Wall -Werror  

LDFLAGS =
DEFS =

TARGETS = bcwipe
BC_OBJ = sha1.o sha1random.o options.o schemes.o

root=/

all: $(TARGETS)

bcwipe: wipe.c $(BC_OBJ)
	$(CC) $(CFLAGS) $(DEFS) -o bcwipe wipe.c $(BC_OBJ) 

install: bcwipe
	./install.sh $(root)
# $(INSTALL) -m 644 bcwipe.1      $(root)/$(MAN_PATH)/man1/
# $(INSTALL) -o root -m 755 -s bcwipe   $(root)/usr/bin/

clean:
	rm -f *.o *.ver *~ $(TARGETS)

#Makefile: clean
