Source

dupfiles / GNUmakefile

#
#    Daybo Logic Dupfiles.
#    Copyright (C) 2005 David Duncan Ross Palmer, Daybo Logic.
#
#    All rights reserved, see license.txt for more information.

THISFILE=GNUmakefile
LL_H=../ll.h
LL_C=../ll.c
LL_O=./ll.o
HEADERS=$(LL_H)
#LIBS=/usr/local/lib/libdaybocrypt.a
LIBS=/opt/lib/libdaybocrypt.a
MASTERDEPS=$(THISFILE) $(HEADERS)
OPTLEVEL=-O3
DBG=-g
INSTDIR=/usr/local/bin/
INCLUDE=-I.. -I/usr/local/include -I. -I../shared/c99.h -I/opt/include
DEFINES=-DHAVE_STDINT_H -DNO_DPCRTLMM -DONE_OUTPUT -D__UNIX__ -DNDEBUG -DRCS_STAMPS -DHAVE_STDBOOL_H
TARGET=./dupfiles
ERASE=perl -w ../shared/scripts/erase.pl
WARNINGS=-Wall -W

ifndef DEBUG
CFLAGS=$(OPTLEVEL) $(INCLUDE) $(DEFINES) $(WARNINGS)
STRIP=strip
else
CFLAGS=$(DBG) $(INCLUDE) $(DEFINES) $(WARNINGS)
STRIP=
endif

CC=cc

$(TARGET) : dupfiles.o $(LL_O) $(MASTERDEPS) $(LIBS)
	$(CC) -o $@ $< $(LL_O) $(LIBS)
ifndef DEBUG
	$(STRIP) $(TARGET)
endif

dupfiles.o : dupfiles.c $(MASTERDEPS) $(LL_H)
	$(CC) -c -o $@ $< $(CFLAGS)

$(LL_O) : $(LL_C) $(LL_H) $(MASTERDEPS)
	$(CC) -c -o $@ $< $(CFLAGS)


#----------- Commands ----------------------

run : $(TARGET)
	$(TARGET)

#-------------------------------------------

clean:
	-$(ERASE) $(TARGET)
	-$(ERASE) dupfiles.o
	-$(ERASE) $(LL_O)

#----------- Installation ------------------

install : $(TARGET)
	@cp -v $(TARGET) $(INSTDIR)

uninstall : deinstall
deinstall:
	-@rm -v $(INSTDIR)$(TARGET)