aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-12-05 11:13:46 +0100
committerMattias Andrée <maandree@operamail.com>2015-12-05 11:13:46 +0100
commit8fb6e77a618ce1a8151fab27445e0c3cc0241134 (patch)
tree73608a9d6880fa65c8046a09b3e6a055d9608ed4 /Makefile
parentaccept flags (diff)
downloadlibpassphrase-8fb6e77a618ce1a8151fab27445e0c3cc0241134.tar.gz
libpassphrase-8fb6e77a618ce1a8151fab27445e0c3cc0241134.tar.bz2
libpassphrase-8fb6e77a618ce1a8151fab27445e0c3cc0241134.tar.xz
beginning of issue #2 on github
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 17 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index a5ee1bc..344d1e1 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ LICENSEDIR = $(DATADIR)/licenses
PKGNAME = libpassphrase
# Options with which to compile the library
-OPTIONS =
+OPTIONS = PASSPHRASE_METER
# PASSPHRASE_ECHO: Do not hide the passphrase
# PASSPHRASE_STAR: Use "*" for each character instead of no echo
# PASSPHRASE_TEXT: Use "(empty)" and "(not empty)" instead of no echo
@@ -42,6 +42,7 @@ OPTIONS =
# PASSPHRASE_DEDICATED: Enable use of dedicated keys
# DEFAULT_INSERT: Use insert mode as default
# PASSPHRASE_INVALID: Prevent duplication of non-initialised memory
+# PASSPHRASE_METER: Enable passphrase strength meter.
# Text to use instead of "*"
PASSPHRASE_STAR_CHAR = *
@@ -82,6 +83,11 @@ CC_FLAGS = $(CPPFLAGS_) $(CFLAGS_) $(OPTIMISE)
LD_FLAGS = $(LDFLAGS_) $(CFLAGS_) $(OPTIMISE)
+# Object files for the library
+OBJ_ = passphrase echoes wipe
+OBJ = $(foreach O,$(OBJ_),obj/$(O).o)
+
+
.PHONY: default
default: lib info
@@ -107,25 +113,25 @@ a: bin/libpassphrase.a
.PHONY: test
test: bin/test
-bin/libpassphrase.so: obj/passphrase.o
+bin/test: bin/libpassphrase.so obj/test.o
+ $(CC) $(LD_FLAGS) -Lbin -lpassphrase -o "$@" obj/test.o $(LDFLAGS)
+
+obj/test.o: src/test.c src/*.h
+ @mkdir -p "$(shell dirname "$@")"
+ $(CC) $(CC_FLAGS) -o "$@" -c "$<" $(CFLAGS) $(CPPFLAGS)
+
+bin/libpassphrase.so: $(OBJ)
@mkdir -p bin
$(CC) $(LD_FLAGS) -shared -Wl,-soname,libpassphrase.so -o "$@" $^ $(LDFLAGS)
-bin/libpassphrase.a: obj/passphrase.o
+bin/libpassphrase.a: $(OBJ)
@mkdir -p bin
ar rcs "$@" $^
-bin/test: bin/libpassphrase.so obj/test.o
- $(CC) $(LD_FLAGS) -Lbin -lpassphrase -o "$@" obj/test.o $(LDFLAGS)
-
-obj/passphrase.o: src/passphrase.c src/*.h
+obj/%.o: src/%.c src/*.h
@mkdir -p "$(shell dirname "$@")"
$(CC) $(CC_FLAGS) -fPIC -o "$@" -c "$<" $(CFLAGS) $(CPPFLAGS)
-obj/test.o: src/test.c src/passphrase.h
- @mkdir -p "$(shell dirname "$@")"
- $(CC) $(CC_FLAGS) -o "$@" -c "$<" $(CFLAGS) $(CPPFLAGS)
-
.PHONY: info
info: bin/libpassphrase.info
bin/%.info: info/%.texinfo