1 ################################################################## 2 # You can modify CC variable if you have compiler other than GCC 3 # But the code was designed and tested with GCC 4 CC = gcc 5 6 ################################################################## 7 # Compilation flags 8 # You should comment the line below for AIX+native cc 9 FLAGS = -Wall 10 11 ################################################################## 12 # Libraries 13 # 14 # You should comment the line below ('LIBS= -lcrypt')for QNX RTP 15 # 6.1.0, OpenBSD 2.8 and above, WIN32 (+MinGW) 16 LIBS = -lcrypt 17 LIBM = -lm 18 # Use lines below for cygwin 19 # LIBS = 20 # LIBM = 21 22 ################################################################## 23 # Support for crypted passwords 24 # 25 # DO NOT EDIT THE LINE BELOW !!! 26 CRYPTED_PASS = APG_DONOTUSE_CRYPT 27 # Coment this if you do not want to use crypted passwords output 28 # or trying to build programm for win32 29 CRYPTED_PASS = APG_USE_CRYPT 30 31 ################################################################## 32 # Support for ANSI X9.17/SHA1 PRNG 33 # 34 # DO NOT EDIT THE LINE BELOW !!! 35 USE_SHA = APG_USE_SHA 36 # Coment this if you want to use PRNG X9.17 with SHA-1 37 USE_SHA = APG_DONOTUSE_SHA 38 39 ################################################################## 40 # Directories 41 # Install dirs 42 INSTALL_PREFIX = /usr/local 43 APG_BIN_DIR = /bin 44 APG_MAN_DIR = /man/man1 45 APGD_BIN_DIR = /sbin 46 APGD_MAN_DIR = /man/man8 47 48 #################################################################### 49 # If you plan to install APG daemon you should look at lines below # 50 #################################################################### 51 52 #################################################################### 53 # FreeBSD 54 # 55 # Uncoment NOTHING for FreeBSD 56 # 57 58 #################################################################### 59 # Linux 60 # 61 # Uncoment line below for LINUX 62 #CS_LIBS = -lnsl 63 64 #################################################################### 65 # Solaris 66 # 67 # Uncoment line below for Solaris 68 #CS_LIBS = -lnsl -lsocket 69 70 #################################################################### 71 # QNX RTP 6.1.0 72 # 73 # Uncoment line below for QNX RTP 6.1.0 74 #CS_LIBS = -lsocket 75 76 # ====== YOU DO NOT NEED TO MODIFY ANYTHING BELOW THIS LINE ====== 77 # Find group ID for user root 78 FIND_GROUP = `grep '^root:' /etc/passwd | awk -F: '{ print $$4 }'` 79 80 PROGNAME = apg 81 CS_PROGNAME = apgd 82 BFM_PROGNAME = apgbfm 83 BFM_SOURCES = apgbfm.c bloom.c sha/sha.c errors.c getopt.c convert.c 84 SOURCES = bloom.c ./sha/sha.c ./cast/cast.c rnd.c pronpass.c \ 85 randpass.c restrict.c errors.c apg.c getopt.c convert.c 86 HEADERS = owntypes.h pronpass.h randpass.h restrict.h errs.h rnd.h \ 87 ./cast/cast.h ./cast/cast_sboxes.h getopt.h convert.h 88 OBJECTS = rnd.o ./cast/cast.o pronpass.o randpass.o restrict.o apg.o errors.o 89 90 standalone: apg apgbfm 91 92 all: cliserv standalone 93 94 cliserv: apgd apgbfm 95 96 cygwin: standalone 97 98 apg: 99 ${CC} ${FLAGS} -D${CRYPTED_PASS} -D${USE_SHA} -o ${PROGNAME} ${SOURCES} ${LIBS} ${LIBM} 100 101 apgd: 102 ${CC} ${FLAGS} -DCLISERV -D${USE_SHA} -o ${CS_PROGNAME} ${SOURCES} ${CS_LIBS} ${LIBM} 103 104 apgbfm: 105 ${CC} ${FLAGS} -DAPGBFM -o ${BFM_PROGNAME} ${BFM_SOURCES} ${LIBM} 106 107 strip: 108 strip ${PROGNAME} 109 strip ${CS_PROGNAME} 110 strip ${BFM_PROGNAME} 111 112 install: 113 if test -x ./apg; then \ 114 ./mkinstalldirs ${INSTALL_PREFIX}${APG_BIN_DIR}; \ 115 ./mkinstalldirs ${INSTALL_PREFIX}${APG_MAN_DIR}; \ 116 ./install-sh -c -m 0755 -o root -g ${FIND_GROUP} ./apg ${INSTALL_PREFIX}${APG_BIN_DIR}; \ 117 ./install-sh -c -m 0444 ./doc/man/apg.1 ${INSTALL_PREFIX}${APG_MAN_DIR}; \ 118 fi 119 if test -x ./apgd; then \ 120 ./mkinstalldirs ${INSTALL_PREFIX}${APGD_BIN_DIR}; \ 121 ./mkinstalldirs ${INSTALL_PREFIX}${APGD_MAN_DIR}; \ 122 ./install-sh -c -m 0755 -o root -g ${FIND_GROUP} ./apgd ${INSTALL_PREFIX}${APGD_BIN_DIR}; \ 123 ./install-sh -c -m 0444 ./doc/man/apgd.8 ${INSTALL_PREFIX}${APGD_MAN_DIR}; \ 124 fi 125 if test -x ./apgbfm; then \ 126 ./mkinstalldirs ${INSTALL_PREFIX}${APG_BIN_DIR}; \ 127 ./mkinstalldirs ${INSTALL_PREFIX}${APG_MAN_DIR}; \ 128 ./install-sh -c -m 0755 -o root -g ${FIND_GROUP} ./apgbfm ${INSTALL_PREFIX}${APG_BIN_DIR}; \ 129 ./install-sh -c -m 0444 ./doc/man/apgbfm.1 ${INSTALL_PREFIX}${APG_MAN_DIR}; \ 130 fi 131 132 install-cygwin: 133 if test -x ./apg.exe; then \ 134 ./mkinstalldirs ${INSTALL_PREFIX}${APG_BIN_DIR}; \ 135 ./mkinstalldirs ${INSTALL_PREFIX}${APG_MAN_DIR}; \ 136 ./install-sh -c -m 0755 ./apg.exe ${INSTALL_PREFIX}${APG_BIN_DIR}; \ 137 ./install-sh -c -m 0444 ./doc/man/apg.1 ${INSTALL_PREFIX}${APG_MAN_DIR}; \ 138 fi 139 if test -x ./apgbfm.exe; then \ 140 ./mkinstalldirs ${INSTALL_PREFIX}${APG_BIN_DIR}; \ 141 ./mkinstalldirs ${INSTALL_PREFIX}${APG_MAN_DIR}; \ 142 ./install-sh -c -m 0755 ./apgbfm.exe ${INSTALL_PREFIX}${APG_BIN_DIR}; \ 143 ./install-sh -c -m 0444 ./doc/man/apgbfm.1 ${INSTALL_PREFIX}${APG_MAN_DIR}; \ 144 fi 145 146 clean: 147 rm -f ${CS_PROGNAME} ${PROGNAME} ${BFM_PROGNAME} ${OBJECTS} *core*