4 ms·
why would you trust someone else to encrypt your files? I use dropbox and this makefile %.enc:% openssl aes-256-cbc -a -salt -in $< -out $@ %:%.enc
by aey 9y ago
why would you trust someone else to encrypt your files?
I use dropbox and this makefile
%.enc:%
openssl aes-256-cbc -a -salt -in $< -out $@
%:%.enc
openssl aes-256-cbc -d -a -in $< -out $@
just not in the shared directory :)
- natch 9y agoWhat is going on here? I tried storing that in a file "Makefile" and created a file called 'foo', then did: $ make foo.enc The output was: make: Circular Makefile.enc <- Makefile dependency dropped. make: Circular foo <- foo.enc dependency dropped. openssl aes-256-cbc -a -salt -in foo -out foo.enc enter aes-256-cbc encryption password: After putting in a password it did encrypt the file, but there's a lot of noise in my output, so maybe I'm doing it wrong. Any clues?
- aey 9y agowell, thats because the rules are for both encrypting and decrypting. %.enc:% %:%.enc In one file. So enc -> file -> enc. You can split them out, so encrypt in one makefile and decrypt in another. make -f Encrypt foo.enc make -f Decrypt foo but thats been bugging me as well, so here is an all in one $E: openssl aes-256-cbc -a -salt -in $(patsubst %.enc,%,$@) -out $@ $D: openssl aes-256-cbc -d -a -in $@.enc -out $@ make E=foo.enc make D=foo use make at your own peril :)