Make all configuration macros available for application by making
[openssl.git] / crypto / md5 / Makefile.ssl
1 #
2 # SSLeay/crypto/md5/Makefile
3 #
4
5 DIR=    md5
6 TOP=    ../..
7 CC=     cc
8 CPP=    $(CC) -E
9 INCLUDES=
10 CFLAG=-g
11 INSTALL_PREFIX=
12 OPENSSLDIR=     /usr/local/ssl
13 INSTALLTOP=/usr/local/ssl
14 MAKE=           make -f Makefile.ssl
15 MAKEDEPPROG=    makedepend
16 MAKEDEPEND=     $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
17 MAKEFILE=       Makefile.ssl
18 AR=             ar r
19
20 MD5_ASM_OBJ=
21
22 CFLAGS= $(INCLUDES) $(CFLAG)
23
24 # We let the C compiler driver to take care of .s files. This is done in
25 # order to be excused from maintaining a separate set of architecture
26 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
27 # gcc, then the driver will automatically translate it to -xarch=v8plus
28 # and pass it down to assembler.
29 AS=$(CC) -c
30 ASFLAGS=$(CFLAGS)
31
32 GENERAL=Makefile
33 TEST=md5test.c
34 APPS=
35
36 LIB=$(TOP)/libcrypto.a
37 LIBSRC=md5_dgst.c md5_one.c
38 LIBOBJ=md5_dgst.o md5_one.o $(MD5_ASM_OBJ)
39
40 SRC= $(LIBSRC)
41
42 EXHEADER= md5.h
43 HEADER= md5_locl.h $(EXHEADER)
44
45 ALL=    $(GENERAL) $(SRC) $(HEADER)
46
47 top:
48         (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
49
50 all:    lib
51
52 lib:    $(LIBOBJ)
53         $(AR) $(LIB) $(LIBOBJ)
54         @echo You may get an error following this line.  Please ignore.
55         - $(RANLIB) $(LIB)
56         @touch lib
57
58 # elf
59 asm/mx86-elf.o: asm/mx86unix.cpp
60         $(CPP) -DELF -x c asm/mx86unix.cpp | as -o asm/mx86-elf.o
61
62 # solaris
63 asm/mx86-sol.o: asm/mx86unix.cpp
64         $(CC) -E -DSOL asm/mx86unix.cpp | sed 's/^#.*//' > asm/mx86-sol.s
65         as -o asm/mx86-sol.o asm/mx86-sol.s
66         rm -f asm/mx86-sol.s
67
68 # a.out
69 asm/mx86-out.o: asm/mx86unix.cpp
70         $(CPP) -DOUT asm/mx86unix.cpp | as -o asm/mx86-out.o
71
72 # bsdi
73 asm/mx86bsdi.o: asm/mx86unix.cpp
74         $(CPP) -DBSDI asm/mx86unix.cpp | sed 's/ :/:/' | as -o asm/mx86bsdi.o
75
76 asm/mx86unix.cpp: asm/md5-586.pl ../perlasm/x86asm.pl
77         (cd asm; $(PERL) md5-586.pl cpp >mx86unix.cpp)
78
79 asm/md5-sparcv8plus.o: asm/md5-sparcv9.S
80         $(CC) $(ASFLAGS) -DMD5_BLOCK_DATA_ORDER -c \
81                 -o asm/md5-sparcv8plus.o asm/md5-sparcv9.S
82
83 # Old GNU assembler doesn't understand V9 instructions, so we
84 # hire /usr/ccs/bin/as to do the job. Note that option is called
85 # *-gcc27, but even gcc 2>=8 users may experience similar problem
86 # if they didn't bother to upgrade GNU assembler. Such users should
87 # not choose this option, but be adviced to *remove* GNU assembler
88 # or upgrade it.
89 asm/md5-sparcv8plus-gcc27.o: asm/md5-sparcv9.S
90         $(CC) $(ASFLAGS) -DMD5_BLOCK_DATA_ORDER -E asm/md5-sparcv9.S | \
91                 /usr/ccs/bin/as -xarch=v8plus - -o asm/md5-sparcv8plus-gcc27.o
92
93 asm/md5-sparcv9.o: asm/md5-sparcv9.S
94         $(CC) $(ASFLAGS) -DMD5_BLOCK_DATA_ORDER -c \
95                 -o asm/md5-sparcv9.o asm/md5-sparcv9.S
96
97 files:
98         $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
99
100 links:
101         @$(TOP)/util/point.sh Makefile.ssl Makefile
102         @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
103         @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
104         @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
105
106 install:
107         @for i in $(EXHEADER) ; \
108         do  \
109         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
110         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
111         done;
112
113 tags:
114         ctags $(SRC)
115
116 tests:
117
118 lint:
119         lint -DLINT $(INCLUDES) $(SRC)>fluff
120
121 depend:
122         $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
123
124 dclean:
125         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
126         mv -f Makefile.new $(MAKEFILE)
127
128 clean:
129         rm -f asm/mx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
130
131 # DO NOT DELETE THIS LINE -- make depend depends on it.
132
133 md5_dgst.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h
134 md5_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md5_dgst.c
135 md5_dgst.o: md5_locl.h
136 md5_one.o: ../../include/openssl/md5.h md5_one.c