makefile


# Makefile for Epson PhotoPC manipulation tool

#	Copyright (c) 1997,1998 Eugene G. Crosser
#	Copyright (c) 1998 Bruce D. Lightner (DOS/Windows support)
#
#	You may do virtually what you wish with this software, as long
#	as the explicit reference to its original author is retained.
#
#	THIS SOFTWARE IS PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY
#	KIND, EITHER EXPRESSED OR IMPLIED.  IN NO EVENT WILL THE
#	COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES RESULTING FROM THE
#	USE OF THIS SOFTWARE.

# -DUNIX
# Use UNIX specific I/O and other things.

# -DDOS
# Use DOS specific I/O and other things.  Do not define here, use
# Makefile.dos file instead.

# -DMSWINDOWS
# Use Windows specific I/O and other things.  Do not define here, use
# Makefile.win file instead.

# -DLOWMEMORY
# Try to work even if the whole image dill not fit in addressable
# memory (e.g DOS or XENIX/286)

# -DINT16=<type-for-16bit-integer>
# Here you need to specify which integer type correspond to 16bit word.
# On Intel x86 and SPARC it is `short' and I think it is the same on
# most reasonable architectures.  But if you have anything really exotic,
# watch out!

# -DHAVE_CFMAKERAW
# Some modern unices have cfmakeraw() function.  If you are not sure,
# do not define this, it will work anyway.

# -DHAVE_SELECT_H
# On some unices, you need to #include <sys/select.h> to use select()
# system call.  On others, you don't and you cannot.  Look if there is
# a file "/usr/include/sys/select.h" and define accordingly.

# -DHAVE_STRFTIME
# use strftime(3) to make file names with format given in -f option

# -DHAVE_PRIOCTL
# use sched_setsheduler() to obtain realtime proprity if possible.
# Will only work if run by root or setuid root.

# -DHAVE_NANOSLEEP
# use nanlosleep() instead of usleep() for short delays.  This may make
# short delays more accurate on some systems (e.g Linux with libc-4) if
# used togrther with HAVE_PRIOCTL.

# This one is good for Linux:
OPTS	= -DUNIX -DINT16=short -DHAVE_CFMAKERAW -DHAVE_STRFTIME \
		-DHAVE_PRIOCTL -DHAVE_NANOSLEEP

# This one is good for Solaris 2.x:
#OPTS	= -DUNIX -DINT16=short -DHAVE_SELECT_H -DHAVE_STRFTIME

# This one is good for BSDi 3.x and FreeBSD
#OPTS	= -DUNIX -DINT16=short -DHAVE_SELECT_H -DHAVE_STRFTIME -DHAVE_CFMAKERAW


BINDEST	= /usr/local/bin
LIBDEST	= /usr/local/lib
INCDEST	= /usr/local/include
MANDEST	= /usr/local/man
MANEXT	= 1

CC	= gcc
CFLAGS	= -O2 -Wall
LD	= gcc
LDFLAGS	=
AR	= ar
RANLIB	= ranlib
INSTALL	= install -c

##### No need to touch anything below this line #####

LIBOBJS	= eph_read.o eph_iob.o eph_err.o eph_cmd.o eph_io.o eph_open.o

.c.o:
	${CC} ${CFLAGS} ${OPTS} -c $<

all:	libeph_io.a photopc epinfo

libeph_io.a:	${LIBOBJS}
	${AR} r $@ $?
	${RANLIB} $@

photopc:	photopc.o jscan.o libeph_io.a
	${LD} ${LDGLAGS} -o $@ photopc.o jscan.o -L. -leph_io

epinfo:	epinfo.o jscan.o
	${LD} ${LDGLAGS} -o $@ epinfo.o jscan.o

clean:
	rm -f *.o

gclean:	clean
	rm -f libeph_io.a photopc epinfo

install:	all
	${INSTALL} -m 755 photopc ${BINDEST}
	${INSTALL} -m 755 epinfo ${BINDEST}
	${INSTALL} -d -m 755 ${MANDEST}/man${MANEXT}
	${INSTALL} -m 644 photopc.man ${MANDEST}/man${MANEXT}/photopc.${MANEXT}
	${INSTALL} -m 644 epinfo.man ${MANDEST}/man${MANEXT}/epinfo.${MANEXT}

install.lib:	libeph_io.a
	${INSTALL} -m 644 libeph_io.a ${LIBDEST}
	${INSTALL} -m 644 eph_io.h ${INCDEST}

eph_cmd.o: eph_io.h
eph_cmd.o: eph_priv.h
eph_err.o: eph_io.h
eph_err.o: eph_priv.h
eph_io.o: eph_io.h
eph_io.o: eph_priv.h
eph_io.o: usleep.h
eph_io.o: comio.h
eph_iob.o: eph_io.h
eph_open.o: eph_io.h
eph_open.o: eph_priv.h
eph_open.o: usleep.h
eph_open.o: comio.h
eph_open.o: usleep.h
eph_read.o: eph_io.h
eph_read.o: comio.h
eph_read.o: usleep.h
epinfo.o: jscan.h
getopt.o: getopt.h
jscan.o: jscan.h
photopc.o: eph_io.h
photopc.o: jscan.h
photopc.o: getopt.h
photopc.o: strcscmp.h
photopc.o: revision.h

Back