2017-11-20 03:05:58 +00:00
|
|
|
CC = occ
|
2017-07-03 01:26:20 +00:00
|
|
|
CFLAGS = -O255 -w255
|
|
|
|
|
2017-11-20 04:03:44 +00:00
|
|
|
LIBRARIES = lib65816crypto lib65816hash
|
|
|
|
|
2024-04-15 03:16:04 +00:00
|
|
|
PROGRAMS = aescbctest aesctrtest aestest aescrypt rc4test cmactest sha1sum \
|
|
|
|
sha1test sha256sum sha256test md5sum md5test md4sum md4test hmactest
|
2017-07-03 01:26:20 +00:00
|
|
|
|
|
|
|
.PHONY: default
|
2017-11-20 04:03:44 +00:00
|
|
|
default: $(LIBRARIES) $(PROGRAMS)
|
2017-07-03 01:26:20 +00:00
|
|
|
|
2017-11-20 03:05:58 +00:00
|
|
|
pagealign.root: pagealign.asm
|
|
|
|
$(CC) -c $<
|
|
|
|
mv pagealign.ROOT pagealign.root
|
2017-07-03 01:26:20 +00:00
|
|
|
|
2023-12-02 03:39:40 +00:00
|
|
|
# Encryption/decryption algorithms
|
2024-04-15 03:16:04 +00:00
|
|
|
aescmac.a: aescmac.c aes.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
2017-11-20 03:05:58 +00:00
|
|
|
aesmodes.a: aesmodes.c aes.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
aes.a: aes.asm aes.macros
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
mv aes.A aes.a
|
2017-07-03 01:26:20 +00:00
|
|
|
|
2023-12-02 03:39:40 +00:00
|
|
|
rc4.a: rc4.cc rc4.h rc4.asm
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
rc4.B: rc4.a
|
|
|
|
|
2017-11-20 03:05:58 +00:00
|
|
|
# Hash algorithms
|
2023-11-30 01:43:03 +00:00
|
|
|
sha1.a: sha1.cc sha1.h sha1.asm sha1.macros hmacimpl.h
|
2017-11-20 03:05:58 +00:00
|
|
|
$(CC) $(CFLAGS) -c $<
|
2017-11-20 04:03:44 +00:00
|
|
|
sha1.B: sha1.a
|
|
|
|
|
2024-04-16 00:46:50 +00:00
|
|
|
sha256.a: sha256.cc sha256.h sha256.asm sha256.macros hmacimpl.h kdfimpl.h
|
2017-11-20 03:05:58 +00:00
|
|
|
$(CC) $(CFLAGS) -c $<
|
2017-11-20 04:03:44 +00:00
|
|
|
sha256.B: sha256.a
|
|
|
|
|
2023-11-30 01:43:03 +00:00
|
|
|
md5.a: md5.cc md5.h md5.asm md5.macros hmacimpl.h
|
2017-11-20 03:05:58 +00:00
|
|
|
$(CC) $(CFLAGS) -c $<
|
2017-11-20 04:03:44 +00:00
|
|
|
md5.B: md5.a
|
|
|
|
|
2023-12-01 00:29:50 +00:00
|
|
|
md4.a: md4.cc md4.h md4.asm md4.macros hmacimpl.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
md4.B: md4.a
|
|
|
|
|
2017-11-20 04:03:44 +00:00
|
|
|
# Libraries
|
2024-04-15 03:16:04 +00:00
|
|
|
lib65816crypto: aescmac.a aesmodes.a aes.a rc4.a rc4.B
|
2017-11-20 04:03:44 +00:00
|
|
|
rm -f $@
|
|
|
|
iix makelib -P $@ $(patsubst %,+%,$^)
|
2023-12-01 00:29:50 +00:00
|
|
|
lib65816hash: sha1.a sha1.B sha256.a sha256.B md5.a md5.B md4.a md4.B
|
2017-11-20 04:03:44 +00:00
|
|
|
rm -f $@
|
|
|
|
iix makelib -P $@ $(patsubst %,+%,$^)
|
2017-07-03 01:26:20 +00:00
|
|
|
|
2017-11-20 03:05:58 +00:00
|
|
|
# Test programs
|
|
|
|
aescbctest.a: aescbctest.c aes.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
aesctrtest.a: aesctrtest.c aes.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
aestest.a: aestest.c aes.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
aescrypt.a: aescrypt.c aes.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
2017-07-03 01:26:20 +00:00
|
|
|
|
2023-12-02 03:39:40 +00:00
|
|
|
rc4test.a: rc4test.c rc4.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
2024-04-15 03:16:04 +00:00
|
|
|
cmactest.a: cmactest.c aes.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
2017-11-20 04:43:31 +00:00
|
|
|
sha1sum.a: sha1sum.c sha1.h cksumcommon.h
|
2017-11-20 03:05:58 +00:00
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
sha1test.a: sha1test.c sha1.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
2017-07-03 01:26:20 +00:00
|
|
|
|
2017-11-20 04:43:31 +00:00
|
|
|
sha256sum.a: sha256sum.c sha256.h cksumcommon.h
|
2017-11-20 03:05:58 +00:00
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
sha256test.a: sha256test.c sha256.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
2017-07-03 01:26:20 +00:00
|
|
|
|
2017-11-20 04:43:31 +00:00
|
|
|
md5sum.a: md5sum.c md5.h cksumcommon.h
|
2017-11-20 03:05:58 +00:00
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
md5test.a: md5test.c md5.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
2017-07-04 04:58:57 +00:00
|
|
|
|
2023-12-01 00:29:50 +00:00
|
|
|
md4sum.a: md4sum.c md4.h cksumcommon.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
md4test.a: md4test.c md4.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
|
|
|
hmactest.a: hmactest.c sha256.h sha1.h md5.h md4.h
|
2023-11-30 01:43:03 +00:00
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
2017-11-20 04:03:44 +00:00
|
|
|
aescbctest: aescbctest.a pagealign.root lib65816crypto
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816crypto -o $@
|
|
|
|
aesctrtest: aesctrtest.a pagealign.root lib65816crypto
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816crypto -o $@
|
|
|
|
aestest: aestest.a pagealign.root lib65816crypto
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816crypto -o $@
|
|
|
|
aescrypt: aescrypt.a pagealign.root lib65816crypto
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816crypto -o $@
|
2017-07-04 04:58:57 +00:00
|
|
|
|
2023-12-02 03:39:40 +00:00
|
|
|
rc4test: rc4test.a lib65816crypto
|
|
|
|
$(CC) $(CFLAGS) $< -L. -llib65816crypto -o $@
|
|
|
|
|
2024-04-15 03:16:04 +00:00
|
|
|
cmactest: cmactest.a lib65816crypto
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816crypto -o $@
|
|
|
|
|
2017-11-20 04:03:44 +00:00
|
|
|
sha1sum: sha1sum.a lib65816hash
|
|
|
|
$(CC) $(CFLAGS) $< -L. -llib65816hash -o $@
|
|
|
|
sha1test: sha1test.a lib65816hash
|
|
|
|
$(CC) $(CFLAGS) $< -L. -llib65816hash -o $@
|
2017-11-20 03:05:58 +00:00
|
|
|
|
2017-11-20 04:03:44 +00:00
|
|
|
sha256sum: sha256sum.a lib65816hash
|
|
|
|
$(CC) $(CFLAGS) $< -L. -llib65816hash -o $@
|
|
|
|
sha256test: sha256test.a lib65816hash
|
|
|
|
$(CC) $(CFLAGS) $< -L. -llib65816hash -o $@
|
2017-11-20 03:05:58 +00:00
|
|
|
|
2017-11-20 04:03:44 +00:00
|
|
|
md5sum: md5sum.a pagealign.root lib65816hash
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816hash -o $@
|
|
|
|
md5test: md5test.a pagealign.root lib65816hash
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816hash -o $@
|
2017-07-04 17:15:00 +00:00
|
|
|
|
2023-12-01 00:29:50 +00:00
|
|
|
md4sum: md4sum.a pagealign.root lib65816hash
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816hash -o $@
|
|
|
|
md4test: md4test.a pagealign.root lib65816hash
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816hash -o $@
|
|
|
|
|
2023-11-30 01:43:03 +00:00
|
|
|
hmactest: hmactest.a lib65816hash
|
|
|
|
$(CC) $(CFLAGS) pagealign.root $< -L. -llib65816hash -o $@
|
2017-07-04 17:15:00 +00:00
|
|
|
|
2017-07-03 01:26:20 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2017-11-20 04:03:44 +00:00
|
|
|
rm -f *.a *.A *.b *.B *.root *.ROOT *.o $(PROGRAMS) $(LIBRARIES)
|