summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cast/Makefile.uni
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/cast/Makefile.uni')
-rw-r--r--src/lib/libcrypto/cast/Makefile.uni123
1 files changed, 123 insertions, 0 deletions
diff --git a/src/lib/libcrypto/cast/Makefile.uni b/src/lib/libcrypto/cast/Makefile.uni
new file mode 100644
index 0000000000..780073e75b
--- /dev/null
+++ b/src/lib/libcrypto/cast/Makefile.uni
@@ -0,0 +1,123 @@
1# Targets
2# make - twidle the options yourself :-)
3# make cc - standard cc options
4# make gcc - standard gcc options
5# make x86-elf - linux-elf etc
6# make x86-out - linux-a.out, FreeBSD etc
7# make x86-solaris
8# make x86-bdsi
9
10# There are 3 possible performance options, experiment :-)
11#OPTS= -DBF_PTR
12#OPTS= -DBF_PTR2
13OPTS=
14
15DIR= cast
16TOP= .
17CC= gcc
18CFLAG= -O3 -fomit-frame-pointer
19
20CPP= $(CC) -E
21INCLUDES=
22INSTALLTOP=/usr/local/lib
23MAKE= make
24MAKEDEPEND= makedepend
25MAKEFILE= Makefile.uni
26AR= ar r
27
28CAST_ENC=c_enc.o
29# or use
30#CAST_ENC=asm/cx86-elf.o
31#CAST_ENC=asm/cx86-out.o
32#CAST_ENC=asm/cx86-sol.o
33#CAST_ENC=asm/cx86bdsi.o
34
35CFLAGS= $(OPTS) $(INCLUDES) $(CFLAG) -DFULL_TEST
36
37GENERAL=Makefile
38TEST=casttest
39APP1=cast_spd
40APP2=castopts
41APPS=$(APP1) $(APP2)
42
43LIB=libcast.a
44LIBSRC=c_skey.c c_ecb.c c_enc.c c_cfb64.c c_ofb64.c
45LIBOBJ=c_skey.o c_ecb.o $(CAST_ENC) c_cfb64.o c_ofb64.o
46
47SRC= $(LIBSRC)
48
49EXHEADER= cast.h
50HEADER= cast_lcl.h $(EXHEADER)
51
52ALL= $(GENERAL) $(SRC) $(HEADER)
53
54all: $(LIB) $(TEST) $(APPS)
55
56$(LIB): $(LIBOBJ)
57 $(AR) $(LIB) $(LIBOBJ)
58 sh $(TOP)/ranlib.sh $(LIB)
59# elf
60asm/cx86-elf.o: asm/cx86unix.cpp
61 $(CPP) -DELF asm/cx86unix.cpp | as -o asm/cx86-elf.o
62
63# solaris
64asm/cx86-sol.o: asm/cx86unix.cpp
65 $(CC) -E -DSOL asm/cx86unix.cpp | sed 's/^#.*//' > asm/cx86-sol.s
66 as -o asm/cx86-sol.o asm/cx86-sol.s
67 rm -f asm/cx86-sol.s
68
69# a.out
70asm/cx86-out.o: asm/cx86unix.cpp
71 $(CPP) -DOUT asm/cx86unix.cpp | as -o asm/cx86-out.o
72
73# bsdi
74asm/cx86bsdi.o: asm/cx86unix.cpp
75 $(CPP) -DBSDI asm/cx86unix.cpp | as -o asm/cx86bsdi.o
76
77asm/cx86unix.cpp:
78 (cd asm; perl cast-586.pl cpp >cx86unix.cpp)
79
80test: $(TEST)
81 ./$(TEST)
82
83$(TEST): $(TEST).c $(LIB)
84 $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB)
85
86$(APP1): $(APP1).c $(LIB)
87 $(CC) -o $(APP1) $(CFLAGS) $(APP1).c $(LIB)
88
89$(APP2): $(APP2).c $(LIB)
90 $(CC) -o $(APP2) $(CFLAGS) $(APP2).c $(LIB)
91
92lint:
93 lint -DLINT $(INCLUDES) $(SRC)>fluff
94
95depend:
96 $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC)
97
98dclean:
99 perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
100 mv -f Makefile.new $(MAKEFILE)
101
102clean:
103 /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
104
105cc:
106 $(MAKE) CC="cc" CFLAG="-O" all
107
108gcc:
109 $(MAKE) CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all
110
111x86-elf:
112 $(MAKE) CAST_ENC="asm/cx86-elf.o" CFLAG="-DELF $(CFLAGS)" all
113
114x86-out:
115 $(MAKE) CAST_ENC="asm/cx86-out.o" CFLAG="-DOUT $(CFLAGS)" all
116
117x86-solaris:
118 $(MAKE) CAST_ENC="asm/cx86-sol.o" CFLAG="-DSOL $(CFLAGS)" all
119
120x86-bdsi:
121 $(MAKE) CAST_ENC="asm/cx86-bdsi.o" CFLAG="-DBDSI $(CFLAGS)" all
122
123# DO NOT DELETE THIS LINE -- make depend depends on it.