Fool-proofing Makefiles
[openssl.git] / crypto / sha / Makefile
1 #
2 # SSLeay/crypto/sha/Makefile
3 #
4
5 DIR=    sha
6 TOP=    ../..
7 CC=     cc
8 CPP=    $(CC) -E
9 INCLUDES=
10 CFLAG=-g
11 MAKEDEPPROG=    makedepend
12 MAKEDEPEND=     $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
13 MAKEFILE=       Makefile
14 AR=             ar r
15
16 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 APPS=
25
26 LIB=$(TOP)/libcrypto.a
27 LIBSRC=sha_dgst.c sha1dgst.c sha_one.c sha1_one.c sha256.c sha512.c
28 LIBOBJ=sha_dgst.o sha1dgst.o sha_one.o sha1_one.o sha256.o sha512.o $(SHA1_ASM_OBJ)
29
30 SRC= $(LIBSRC)
31
32 EXHEADER= sha.h
33 HEADER= sha_locl.h $(EXHEADER)
34
35 ALL=    $(GENERAL) $(SRC) $(HEADER)
36
37 top:
38         (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
39
40 all:    lib
41
42 lib:    $(LIBOBJ)
43         $(AR) $(LIB) $(LIBOBJ)
44         $(RANLIB) $(LIB) || echo Never mind.
45         @touch lib
46
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         (cd asm; $(PERL) sha512-sse2.pl elf $(CFLAGS) $(PROCESSOR) > ../$@)
52 # 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 sx86-out.s: asm/sha1-586.pl ../perlasm/x86asm.pl
59         (cd asm; $(PERL) sha1-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
60 s512sse2-out.s:     asm/sha512-sse2.pl ../perlasm/x86asm.pl
61         (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
66         (cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
67 sha512-ia64.s: asm/sha512-ia64.pl
68         (cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
69
70 files:
71         $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
72
73 links:
74         @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
75         @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
76         @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
77
78 install:
79         @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
80         @headerlist="$(EXHEADER)"; for i in $$headerlist ; \
81         do  \
82         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
83         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
84         done;
85
86 tags:
87         ctags $(SRC)
88
89 tests:
90
91 lint:
92         lint -DLINT $(INCLUDES) $(SRC)>fluff
93
94 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         mv -f Makefile.new $(MAKEFILE)
100
101 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.
105
106 sha1_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
107 sha1_one.o: ../../include/openssl/opensslconf.h
108 sha1_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
109 sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
110 sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
111 sha1_one.o: sha1_one.c
112 sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
113 sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h
114 sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h
115 sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
116 sha256.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
117 sha256.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
118 sha256.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
119 sha256.o: ../../include/openssl/symhacks.h ../md32_common.h sha256.c
120 sha512.o: ../../e_os.h ../../include/openssl/bio.h
121 sha512.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
122 sha512.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
123 sha512.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
124 sha512.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
125 sha512.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
126 sha512.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
127 sha512.o: ../cryptlib.h sha512.c
128 sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
129 sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h
130 sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h
131 sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
132 sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
133 sha_one.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
134 sha_one.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
135 sha_one.o: ../../include/openssl/symhacks.h sha_one.c