Skip to content

Commit

Permalink
some makefile correction (TODO - move all *.o to separate folder)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnatsakanov Andrey committed Sep 18, 2014
1 parent 37e5904 commit 1cd9f41
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
libs/**
build/**
**.o
**.a
**.so
**.**~
**.**#
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
# We will use OpenSSL/LibreSSL for now
CRYPTO_ENGINE = src/soter/openssl
CFLAGS += -Isrc/soter -fPIC
include $(CRYPTO_ENGINE)/soter.mk

SOTER_BIN = soter
BIN_PATH = build
OBJ_PATH = build/obj
TEST_PATH = build/tests

TEST_OBJ += tests/soter/soter.o
TEST_BIN = test
include src/soter/soter.mk

all: static

static: $(SOTER_OBJ)
$(AR) rcs lib$(SOTER_BIN).a $(SOTER_OBJ)
$(AR) rcs $(BIN_PATH)/lib$(SOTER_BIN).a $(SOTER_OBJ)

shared: $(SOTER_OBJ)
$(CC) -shared -o lib$(SOTER_BIN).so $(SOTER_OBJ)
$(CC) -shared -o $(BIN_PATH)/lib$(SOTER_BIN).so $(SOTER_OBJ)

test: $(TEST_OBJ)
$(CC) -o test $(TEST_OBJ) -L. -lsoter $(LDFLAGS)
include tests/test.mk

clean:
rm -f $(SOTER_OBJ)
Expand Down
12 changes: 12 additions & 0 deletions src/common/error.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @file
*
* (c) CossackLabs
*/

#ifndef _ERROR_HPP_
#define _ERROR_HPP_



#endif /* _ERROR_HPP_ */
2 changes: 1 addition & 1 deletion src/soter/openssl/soter.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SOTER_OBJ = $(patsubst %.c,%.o, $(wildcard $(CRYPTO_ENGINE)/*.c))

# Put path to your OpenSSL/LibreSSL here
OPENSSL_DIR = /home/ignat/ph/librebin
OPENSSL_DIR = libs/libebin

CFLAGS += -I$(OPENSSL_DIR)/include
LDFLAGS += -L$(OPENSSL_DIR)/lib -lcrypto
Expand Down
3 changes: 3 additions & 0 deletions src/soter/soter.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include $(CRYPTO_ENGINE)/soter.mk

SOTER_BIN = soter
2 changes: 2 additions & 0 deletions tests/soter/soter.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SOTER_TEST_OBJ = $(patsubst %.c,%.o, $(wildcard tests/soter/*.c))

7 changes: 7 additions & 0 deletions tests/test.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include tests/soter/soter.mk


soter_test: $(SOTER_TEST_OBJ)
$(CC) -o $(TEST_PATH)/soter_test $(SOTER_TEST_OBJ) -L$(BIN_PATH) -lsoter $(LDFLAGS)

test: soter_test

0 comments on commit 1cd9f41

Please sign in to comment.