aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-07 18:33:12 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-07 18:33:12 +0200
commitf822e622bb4a112e38dc74bf11f1b3a1e6e066f2 (patch)
tree384916009aa79f9c80d60d9f874a028641ba8b62 /Makefile
parentfix warnings (diff)
downloadlibpassphrase-f822e622bb4a112e38dc74bf11f1b3a1e6e066f2.tar.gz
libpassphrase-f822e622bb4a112e38dc74bf11f1b3a1e6e066f2.tar.bz2
libpassphrase-f822e622bb4a112e38dc74bf11f1b3a1e6e066f2.tar.xz
add test + fix example in info manual1396888621
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--Makefile19
1 files changed, 13 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index ee19cf7..c9afc10 100644
--- a/Makefile
+++ b/Makefile
@@ -57,24 +57,24 @@ STD = gnu99
# C preprocessor flags
CPPFLAGS_ = $(foreach D, $(OPTIONS), -D'$(D)=1') $(CPPFLAGS)
# C compiling flags
-CFLAGS_ = -std=$(STD) $(WARN) -fPIC $(CFLAGS)
+_fPIC = -fPIC
+CFLAGS_ = -std=$(STD) $(WARN) $(_fPIC) $(CFLAGS)
# Linking flags
-LDFLAGS_ = -shared $(LDFLAGS)
+_shared = -shared
+LDFLAGS_ = $(_shared) $(LDFLAGS)
# Flags to use when compiling and assembling
CC_FLAGS = $(CPPFLAGS_) $(CFLAGS_) $(OPTIMISE)
# Flags to use when linking
LD_FLAGS = $(LDFLAGS_) $(CFLAGS_) $(OPTIMISE)
-SRC = passphrase
-OBJ = $(foreach S, $(SRC), obj/$(S).o)
.PHONY: default
default: libpassphrase info
.PHONY: all
-all: libpassphrase doc
+all: libpassphrase test doc
.PHONY: doc
doc: info pdf ps dvi
@@ -82,7 +82,14 @@ doc: info pdf ps dvi
.PHONY: libpassphrase
libpassphrase: bin/libpassphrase.so
-bin/libpassphrase.so: $(OBJ)
+.PHONY: test
+test: bin/test
+
+bin/libpassphrase.so: obj/passphrase.o
+ @mkdir -p bin
+ $(CC) $(LD_FLAGS) -o "$@" $^
+
+bin/test: obj/passphrase.o obj/test.o
@mkdir -p bin
$(CC) $(LD_FLAGS) -o "$@" $^