Proper support for OpenBSD-i386 shared build, including assember modules!
[openssl.git] / crypto / cast / Makefile.ssl
index 0143827ae5d01a798f390d705ef84cd2aaf8e8a2..cf39b827daf17e3aef16193fb3b1502df927f0c8 100644 (file)
@@ -8,9 +8,12 @@ CC=    cc
 CPP=   $(CC) -E
 INCLUDES=
 CFLAG=-g
+INSTALL_PREFIX=
+OPENSSLDIR=     /usr/local/ssl
 INSTALLTOP=/usr/local/ssl
 MAKE=          make -f Makefile.ssl
-MAKEDEPEND=    makedepend -f Makefile.ssl
+MAKEDEPPROG=   makedepend
+MAKEDEPEND=    $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 MAKEFILE=      Makefile.ssl
 AR=            ar r
 
@@ -22,6 +25,8 @@ CAST_ENC=c_enc.o
 #CAST_ENC=asm/cx86bdsi.o
 
 CFLAGS= $(INCLUDES) $(CFLAG)
+ASFLAGS= $(INCLUDES) $(ASFLAG)
+AFLAGS= $(ASFLAGS)
 
 GENERAL=Makefile
 TEST=casttest.c
@@ -45,45 +50,33 @@ all:        lib
 
 lib:   $(LIBOBJ)
        $(AR) $(LIB) $(LIBOBJ)
-       sh $(TOP)/util/ranlib.sh $(LIB)
+       $(RANLIB) $(LIB) || echo Never mind.
        @touch lib
 
-# elf
-asm/cx86-elf.o: asm/cx86unix.cpp
-       $(CPP) -DELF asm/cx86unix.cpp | as -o asm/cx86-elf.o
-
-# solaris
-asm/cx86-sol.o: asm/cx86unix.cpp
-       $(CC) -E -DSOL asm/cx86unix.cpp | sed 's/^#.*//' > asm/cx86-sol.s
-       as -o asm/cx86-sol.o asm/cx86-sol.s
-       rm -f asm/cx86-sol.s
-
+# ELF
+asm/cx86-elf.s: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+       (cd asm; $(PERL) cast-586.pl elf $(CLAGS) $(PROCESSOR) > ../$@)
+# COFF
+asm/cx86-cof.s: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+       (cd asm; $(PERL) cast-586.pl coff $(CLAGS) $(PROCESSOR) > ../$@)
 # a.out
-asm/cx86-out.o: asm/cx86unix.cpp
-       $(CPP) -DOUT asm/cx86unix.cpp | as -o asm/cx86-out.o
-
-# bsdi
-asm/cx86bsdi.o: asm/cx86unix.cpp
-       $(CPP) -DBSDI asm/cx86unix.cpp | as -o asm/cx86bsdi.o
-
-asm/cx86unix.cpp:
-       (cd asm; perl cast-586.pl cpp >cx86unix.cpp)
+cx86-out.s: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+       (cd asm; $(PERL) cast-586.pl a.out $(CLAGS) $(PROCESSOR) > ../$@)
 
 files:
-       perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
+       $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
 
 links:
-       /bin/rm -f Makefile
-       $(TOP)/util/point.sh Makefile.ssl Makefile ;
-       $(TOP)/util/mklink.sh ../../include $(EXHEADER)
-       $(TOP)/util/mklink.sh ../../test $(TEST)
-       $(TOP)/util/mklink.sh ../../apps $(APPS)
+       @sh $(TOP)/util/point.sh Makefile.ssl Makefile
+       @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
+       @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
+       @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
 
 install:
        @for i in $(EXHEADER) ; \
        do  \
-       (cp $$i $(INSTALLTOP)/include/$$i; \
-       chmod 644 $(INSTALLTOP)/include/$$i ); \
+       (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
+       chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
        done;
 
 tags:
@@ -95,15 +88,29 @@ lint:
        lint -DLINT $(INCLUDES) $(SRC)>fluff
 
 depend:
-       $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC)
+       $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
 
 dclean:
-       perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
+       $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       /bin/rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
-
-errors:
+       rm -f asm/cx86unix.cpp asm/*.s asm/*.o *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
+
+c_cfb64.o: ../../e_os.h ../../include/openssl/cast.h
+c_cfb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
+c_cfb64.o: c_cfb64.c cast_lcl.h
+c_ecb.o: ../../e_os.h ../../include/openssl/cast.h
+c_ecb.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
+c_ecb.o: ../../include/openssl/opensslv.h c_ecb.c cast_lcl.h
+c_enc.o: ../../e_os.h ../../include/openssl/cast.h
+c_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
+c_enc.o: c_enc.c cast_lcl.h
+c_ofb64.o: ../../e_os.h ../../include/openssl/cast.h
+c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
+c_ofb64.o: c_ofb64.c cast_lcl.h
+c_skey.o: ../../e_os.h ../../include/openssl/cast.h
+c_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
+c_skey.o: c_skey.c cast_lcl.h cast_s.h