diff options
| author | J08nY | 2018-07-16 15:38:20 +0200 |
|---|---|---|
| committer | J08nY | 2018-07-16 15:38:20 +0200 |
| commit | 891e3a97bc2015b5cc8116e637366f56942f8a82 (patch) | |
| tree | 5655753df80dadc878ed90ca20d1b2c751c82a48 | |
| parent | 2428920c53ac6bb136f09f645c253d098ca1a45c (diff) | |
| download | ecgen-891e3a97bc2015b5cc8116e637366f56942f8a82.tar.gz ecgen-891e3a97bc2015b5cc8116e637366f56942f8a82.tar.zst ecgen-891e3a97bc2015b5cc8116e637366f56942f8a82.zip | |
| -rw-r--r-- | Makefile | 7 | ||||
| -rw-r--r-- | src/Makefile | 10 |
2 files changed, 16 insertions, 1 deletions
@@ -50,6 +50,13 @@ help: @echo " - clean-all : cleans all" @echo " - format : run clang-format on source files" @echo " - help : print this help" + @echo + @echo "Available variables:" + @echo " - CC : The compiler to use" + @echo " - DEBUG : Whether to enable DEBUG build = default 0" + @echo " - TEST : Whether to enable TEST build(code coverage) = default 0" + @echo " - FAST : Whether to enable additional optimization(gcc only) = default 0" + @echo " - STATIC : Whether to link PARI statically = default 0" .PHONY: all clean clean-all docs test unittest help diff --git a/src/Makefile b/src/Makefile index 8adbc53..4818f3c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -11,6 +11,8 @@ CFLAGS = -Wall DEBUG ?= 0 TEST ?= 0 FAST ?= 0 +STATIC ?= 0 + ifeq ($(DEBUG), 1) CFLAGS += -DDEBUG -g -Og -Werror -pedantic else ifeq ($(TEST), 1) @@ -24,10 +26,16 @@ else ifeq ($(FAST), 1) else CFLAGS += -DNDEBUG -O2 endif + LDFLAGS = -L../lib/parson -L../lib/sha1 -L../lib/pari +ifeq ($(STATIC), 1) + LIBS = -lrt -Wl,-Bstatic -lpari -Wl,-Bdynamic -lpthread -lparson -lsha1 -lm -lgmp -ldl +else + LIBS = -lrt -lpari -lpthread -lparson -lsha1 +endif INCLUDES = -I. -I../lib -LIBS = -lrt -lpari -lpthread -lparson -lsha1 + GIT_COMMIT = $(shell git rev-parse --short HEAD) ifneq ($(GIT_COMMIT),) |
