From f822e622bb4a112e38dc74bf11f1b3a1e6e066f2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 7 Apr 2014 18:33:12 +0200 Subject: add test + fix example in info manual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Makefile') 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 "$@" $^ -- cgit v1.2.3-70-g09d2