Minor changes
[staff/wgh1/pwcrypt.git] / Makefile
CommitLineData
0e2f4224
HW
1#
2# Makefile for pwcrypt
3#
4# (c) 2016 WGH1@BFH
5#
6#
7
8# Compiler to use
9CC=gcc
10
11# Password generator to use (for demo)
12PG=pwgen
13
14all: pwcrypt test demo
15
16# Compile pwcrypt
17pwcrypt: pwcrypt.c
18 $(CC) pwcrypt.c -l crypt -o pwcrypt
19
20# Test with SHA-512 encryption (first $ masks second $)
21test=$(shell ./pwcrypt '$$6$$__Salt__$$' '& __Pepper__')
22test: pwcrypt
23 @echo 'Hash: $(test)'
24
25# Demo with SHA-512 ("pwgen" required for random salt & pepper)
26demo=$(shell ./pwcrypt '$(salt)' '$(pepper)')
27demo: pwcrypt salt pepper
28 @echo 'Hash: $(demo)'
29
30# Salt for demo
31salt:=$$6$$$(shell $(PG) -1)$$
32salt: pwgen
33 @echo 'Salt: $(salt)'
34
35# Pepper (Password) for demo
36pepper:=$(shell $(PG) -1 12)
37pepper: pwgen
38 @echo 'Pass: $(pepper)'
39
40# Check if pwgen is installed on the system
41pwgen:
42 @which $(PG) > /dev/null || echo Install "$(PG)" first
43
ad0a1c77
HW
44# Dist Package
45dist: pwcrypt.c Makefile
46 @tar -cpzf pwcrypt.tgz pwcrypt.c Makefile
47
0e2f4224
HW
48# remove pwcrypt binary
49clean:
50 -rm pwcrypt