Makefile 2.8 KB
Newer Older
1 2 3 4
#
# SSLeay/crypto/sha/Makefile
#

5 6 7
DIR=    sha
TOP=    ../..
CC=     cc
8
CPP=    $(CC) -E
9 10
INCLUDES=
CFLAG=-g
11 12
MAKEDEPPROG=	makedepend
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
B
Ben Laurie 已提交
13
MAKEFILE=       Makefile
14 15 16
AR=             ar r

SHA1_ASM_OBJ=
17 18

CFLAGS= $(INCLUDES) $(CFLAG)
19
ASFLAGS= $(INCLUDES) $(ASFLAG)
20
AFLAGS= $(ASFLAGS)
21 22

GENERAL=Makefile
23
TEST=shatest.c sha1test.c sha256t.c sha512t.c
24 25 26
APPS=

LIB=$(TOP)/libcrypto.a
27 28
LIBSRC=sha_dgst.c sha1dgst.c sha_one.c sha1_one.c sha256.c sha512.c
LIBOBJ=sha_dgst.o sha1dgst.o sha_one.o sha1_one.o sha256.o sha512.o $(SHA1_ASM_OBJ)
29 30 31 32

SRC= $(LIBSRC)

EXHEADER= sha.h
33
HEADER= sha_locl.h $(EXHEADER)
34 35 36 37 38 39

ALL=    $(GENERAL) $(SRC) $(HEADER)

top:
	(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)

40
all:    lib
41

42
lib:    $(LIBOBJ)
43
	$(AR) $(LIB) $(LIBOBJ)
44
	$(RANLIB) $(LIB) || echo Never mind.
45 46
	@touch lib

47
# ELF
48
sx86-elf.s: asm/sha1-586.pl ../perlasm/x86asm.pl
49
	(cd asm; $(PERL) sha1-586.pl elf $(CFLAGS) $(PROCESSOR) > ../$@)
50
s512sse2-elf.s:	asm/sha512-sse2.pl ../perlasm/x86asm.pl
51 52
	(cd asm; $(PERL) sha512-sse2.pl elf $(CFLAGS) $(PROCESSOR) > ../$@)
# COFF
53
sx86-cof.s: asm/sha1-586.pl ../perlasm/x86asm.pl
54
	(cd asm; $(PERL) sha1-586.pl coff $(CFLAGS) $(PROCESSOR) > ../$@)
55
s512sse2-cof.s:     asm/sha512-sse2.pl ../perlasm/x86asm.pl
56
	(cd asm; $(PERL) sha512-sse2.pl coff $(CFLAGS) $(PROCESSOR) > ../$@)
57
# a.out
58 59 60 61
sx86-out.s: asm/sha1-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha1-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
s512sse2-out.s:     asm/sha512-sse2.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha512-sse2.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
62

63
sha1-ia64.s:   asm/sha1-ia64.pl
64
	(cd asm; $(PERL) sha1-ia64.pl $(CFLAGS) ) > $@
65
sha256-ia64.s: asm/sha512-ia64.pl
A
Andy Polyakov 已提交
66
	(cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
67
sha512-ia64.s: asm/sha512-ia64.pl
A
Andy Polyakov 已提交
68
	(cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
69

70
files:
B
Ben Laurie 已提交
71
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
72 73

links:
74 75 76
	@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
	@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
77 78

install:
A
Andy Polyakov 已提交
79
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
80
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
81
	do  \
82 83
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
	chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
84 85 86 87 88 89 90 91 92 93 94
	done;

tags:
	ctags $(SRC)

tests:

lint:
	lint -DLINT $(INCLUDES) $(SRC)>fluff

depend:
95
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
96 97

dclean:
98
	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
99 100 101
	mv -f Makefile.new $(MAKEFILE)

clean:
102
	rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
103 104

# DO NOT DELETE THIS LINE -- make depend depends on it.
B
Ben Laurie 已提交
105

106
sha1_one.o: sha1_one.c
B
Bodo Möller 已提交
107 108
sha512.o: sha512.c
sha_one.o: sha_one.c