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
10 # There are 3 possible performance options, experiment :-)
18 CFLAG= -O3 -fomit-frame-pointer
22 INSTALLTOP=/usr/local/lib
24 MAKEDEPEND= makedepend
25 MAKEFILE= Makefile.uni
31 #CAST_ENC=asm/cx86-elf.o
32 #CAST_ENC=asm/cx86-out.o
33 #CAST_ENC=asm/cx86-sol.o
34 #CAST_ENC=asm/cx86bdsi.o
36 CFLAGS= $(OPTS) $(INCLUDES) $(CFLAG) -DFULL_TEST
45 LIBSRC=c_skey.c c_ecb.c c_enc.c c_cfb64.c c_ofb64.c
46 LIBOBJ=c_skey.o c_ecb.o $(CAST_ENC) c_cfb64.o c_ofb64.o
51 HEADER= cast_lcl.h $(EXHEADER)
53 ALL= $(GENERAL) $(SRC) $(HEADER)
55 all: $(LIB) $(TEST) $(APPS)
58 $(AR) $(LIB) $(LIBOBJ)
61 asm/cx86-elf.o: asm/cx86unix.cpp
62 $(CPP) -DELF asm/cx86unix.cpp | as -o asm/cx86-elf.o
65 asm/cx86-sol.o: asm/cx86unix.cpp
66 $(CC) -E -DSOL asm/cx86unix.cpp | sed 's/^#.*//' > asm/cx86-sol.s
67 as -o asm/cx86-sol.o asm/cx86-sol.s
71 asm/cx86-out.o: asm/cx86unix.cpp
72 $(CPP) -DOUT asm/cx86unix.cpp | as -o asm/cx86-out.o
75 asm/cx86bsdi.o: asm/cx86unix.cpp
76 $(CPP) -DBSDI asm/cx86unix.cpp | as -o asm/cx86bsdi.o
79 (cd asm; perl cast-586.pl cpp >cx86unix.cpp)
84 $(TEST): $(TEST).c $(LIB)
85 $(CC) -o $(TEST) $(CFLAGS) $(TEST).c $(LIB)
87 $(APP1): $(APP1).c $(LIB)
88 $(CC) -o $(APP1) $(CFLAGS) $(APP1).c $(LIB)
90 $(APP2): $(APP2).c $(LIB)
91 $(CC) -o $(APP2) $(CFLAGS) $(APP2).c $(LIB)
94 lint -DLINT $(INCLUDES) $(SRC)>fluff
97 $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC)
100 perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
101 mv -f Makefile.new $(MAKEFILE)
104 /bin/rm -f $(LIB) $(TEST) $(APPS) *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
107 $(MAKE) CC="cc" CFLAG="-O" all
110 $(MAKE) CC="gcc" CFLAGS="-O3 -fomit-frame-pointer" all
113 $(MAKE) CAST_ENC="asm/cx86-elf.o" CFLAG="-DELF $(CFLAGS)" all
116 $(MAKE) CAST_ENC="asm/cx86-out.o" CFLAG="-DOUT $(CFLAGS)" all
119 $(MAKE) CAST_ENC="asm/cx86-sol.o" CFLAG="-DSOL $(CFLAGS)" all
122 $(MAKE) CAST_ENC="asm/cx86-bdsi.o" CFLAG="-DBDSI $(CFLAGS)" all
124 # DO NOT DELETE THIS LINE -- make depend depends on it.