#
#
#                         DES SOFTWARE PACKAGE
#                             Version 2.2
#
#                                        _
# Copyright (c) 1990,1991,1992,1993 Stig Ostholm.
# All Rights Reserved
#
#
# The author takes no responsibility of actions caused by the use of this
# software package and does not guarantee the correctness of the functions.
#
# This software package may be freely distributed for non-commercial purpose
# as long as the copyright notice is kept. Any changes made should be
# accompanied by a comment indicating who made the change, when it was made
# and what was changed.
#
# This software package, or any parts of it, may not be used or in any way
# re-distributed for commercial purpose without the authors permission.
# The author keeps the right to decide between of what is commercial and
# what is non-commercial purpose.
#
# Restrictions due to national laws governing the use, import or export of
# cryptographic software is the responsibility of the software user/importer/
# exporter to follow.
#
#
#                                              _
#                                         Stig Ostholm
#                                         Chalmers University of Technology
#                                         Department of Computer Engineering
#                                         S-412 96 Gothenburg
#                                         Sweden
#                                         ----------------------------------
#                                         Email: ostholm@ce.chalmers.se
#                                         Phone: +46 31 772 1703
#                                         Fax:   +46 31 772 3663
#

#
# All make programs dont have the .h suffix defined
#
.SUFFIXES: .h .sh

       TOPDIR = ..
         IDIR = include
      SUBDIRS = test ${IDIR}

#           CC = gcc
      DEFINES = -DCONFIG
     INCLUDES = -I${IDIR}
        CCOPT =
#        CCOPT = -g
       CFLAGS = ${CCOPT} ${DEFINES} ${INCLUDES}
      LDFLAGS =

           RM = rm -f
           MV = mv
           CP = ln
         ECHO = echo
         MAKE = make

    MAKE_ARGS = 'TOPDIR=${TOPDIR}/..' 'MAKE=${MAKE}' 'ECHO=${ECHO}' 'RM=${RM}' \
		'CC=${CC}' 'CCOPT=${CCOPT}' 'BINDIR=${BINDIR}' \
		'LIBDIR=${LIBDIR}' 'INCDIR=${INCDIR}' 'MANDIR=${MANDIR}'

 MAKE_SUBDIRS = case '${MFLAGS}' in -*s*) :;; *) set -x;; esac; \
		for D in ${SUBDIRS}; do \
			( cd $$D && ${MAKE} ${MFLAGS} ${MAKE_ARGS} $@ ); \
		done


      SRCS = gen_hrdwr.c

      OBJS = gen_hrdwr.o

     PROGS = hrdwr.x

      HDRS = ${IDIR}/config.h ${IDIR}/cc.h ${IDIR}/sys.h ${IDIR}/hrdwr.h

     REMOVES = ${PROGS}


all	: ${HDRS}
	@ ${MAKE_SUBDIRS}


${IDIR}/config.h : config.h
	${RM} ${IDIR}/tmp.h
	${CP} $? ${IDIR}/tmp.h
	${MV} ${IDIR}/tmp.h ${IDIR}/config.h

${IDIR}/cc.h : cc.h
	${RM} ${IDIR}/tmp.h
	${CP} $? ${IDIR}/tmp.h
	${MV} ${IDIR}/tmp.h ${IDIR}/cc.h

${IDIR}/sys.h	: sys.sh
	./$? ${MFLAGS} 'IDIR=${IDIR}' 'CC=${CC}' 'CFLAGS=${CFLAGS}' 'RM=${RM}' 'ECHO=${ECHO}' 'CP=${CP}' -o $@

${IDIR}/hrdwr.h : hrdwr.x
	${RM} tmp.h
	./$? > tmp.h
	${MV} tmp.h $@


install	:
	@ ${MAKE_SUBDIRS}

clean	:
	${RM} ${REMOVES} *.o core a.out tmp.c tmp.h *.NEW *.BAK
	@ ${MAKE_SUBDIRS}

depend  :
	${TOPDIR}/util/mkdepend.sh ${MFLAGS} 'CC=${CC}' 'CFLAGS=${CFLAGS}' 'RM=${RM}' -f Makefile ${SRCS}
	@ ${MAKE_SUBDIRS}


hrdwr.x	: gen_hrdwr.c ${IDIR}/config.h ${IDIR}/cc.h ${IDIR}/sys.h
	${CC} ${CFLAGS} -o $@ gen_hrdwr.c ${LDFLAGS}


# DEPEND
#
# Don not change the lines below, run make depend
#
