crypt.u.mak

最終更新:2009/12/16

crypt.u.mak

001: #
002: # Makefile for APR Samples
003: #
004: # はじめに Shift_JIS のソースコードを ORG の下に保管しておく。
005: # Usage:
006: # make -f crypt.u.mak
007: #
008: 
009: APR_CONFIG=$(shell which apr-1-config)
010: APU_CONFIG=$(shell which apu-1-config)
011: 
012: CC=gcc
013: ICONV=iconv
014: 
015: CFLAGS=$(shell ${APR_CONFIG} --cflags --cppflags --includes) -Wall
016: LDFLAGS=$(shell ${APR_CONFIG} --ldflags)
017: LDLIBS=$(shell ${APR_CONFIG} --libs --link-ld) $(shell ${APU_CONFIG} --libs --link-ld) -lcrypto
018: 
019: default:	buildall
020: 
021: buildall:	kcrypt
022: 
023: clean:
024: 	$(RM) *.o *.c *.h *~ kcrypt
025: 
026: mystab.o:	mystab.h
027: mycipher.o:	mycipher.h
028: kcrypt.o:	mystab.h mycipher.h mybb.h
029: 
030: mystab.h:	ORG/mystab.h
031: 	$(ICONV) -f Shift_JIS -t EUC-JP $< > $@
032: 
033: mystab.c:	ORG/mystab.c
034: 	$(ICONV) -f Shift_JIS -t EUC-JP $< > $@
035: 
036: mycipher.h:	ORG/mycipher.h
037: 	$(ICONV) -f Shift_JIS -t EUC-JP $< > $@
038: 
039: mycipher.c:	ORG/mycipher.c
040: 	$(ICONV) -f Shift_JIS -t EUC-JP $< > $@
041: 
042: mybb.h:	ORG/mybb.h
043: 	$(ICONV) -f Shift_JIS -t EUC-JP $< > $@
044: 
045: mybb.c:	ORG/mybb.c
046: 	$(ICONV) -f Shift_JIS -t EUC-JP $< > $@
047: 
048: kcrypt.c:	ORG/kcrypt.c
049: 	$(ICONV) -f Shift_JIS -t EUC-JP $< > $@
050: 
051: kcrypt:	kcrypt.o mystab.o mycipher.o mybb.o
052: 	$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
053: 
054: test1:	kcrypt
055: 	./kcrypt aes-128-cbc enc mycipher.c mycipher.c.enc
056: 	./kcrypt aes-128-cbc dec mycipher.c.enc mycipher.c.enc.dec
057: 	diff mycipher.c mycipher.c.enc.dec
058: 	$(RM) mycipher.c.enc mycipher.c.enc.dec
059: 
060: test2:	kcrypt
061: 	./kcrypt camellia-128-cbc enc mycipher.c mycipher.c.enc
062: 	./kcrypt camellia-128-cbc dec mycipher.c.enc mycipher.c.enc.dec
063: 	diff mycipher.c mycipher.c.enc.dec
064: 	$(RM) mycipher.c.enc mycipher.c.enc.dec
Copyright (C) KAKU PROJECT (2009)KAKU PROJECT (2009)