1 #!/usr/bin/make -f 2 3 package := NotePad.apk 4 5 all: out/signed-$(package) 6 7 clean: 8 rm -rf out 9 10 .PHONY: FORCE 11 12 DSAPARAM := out/dsaparam 13 $(DSAPARAM): 14 mkdir -p $(dir $@) 15 umask 0077 && openssl dsaparam -out $@ 1024 16 17 %.pem: $(DSAPARAM) FORCE 18 mkdir -p $(dir $@) 19 umask 0077 && openssl gendsa -out $@.pk~ $(DSAPARAM) 20 umask 0077 && openssl pkcs8 -topk8 -nocrypt \ 21 -in $@.pk~ -out $@.pk 22 umask 0077 && openssl req -new -x509 -key $@.pk -out $@ -days 1095 \ 23 -subj "/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/emailAddress=android (at] android.com" 24 25 cert := out/key1.pem 26 out/signed-$(package): $(package) $(cert) 27 mkdir -p $(dir $@) 28 SIGNAPK_DEBUG=1 \ 29 signapk -input $< -output $@ \ 30 -key $(cert).pk -cert $(cert) -tempdir out 31