aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2020-09-05 18:25:39 +0200
committerJan200101 <sentrycraft123@gmail.com>2020-09-05 18:25:39 +0200
commitc9333913641ec1b51725f918573d4faae7ecfc8f (patch)
tree30467ebaa10a67d15d1d7306b05dbd2912e0babc /Makefile
parent85aeb601b330a43c04fd484b07499e18b2680e01 (diff)
downloadpolecat-c9333913641ec1b51725f918573d4faae7ecfc8f.tar.gz
polecat-c9333913641ec1b51725f918573d4faae7ecfc8f.zip
Update Makefile to make the life of packagers easier
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 10 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index ead2f10..e2e1ca0 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,6 @@ ifeq ($(TARGET),debug)
endif
PRETTY_OUTPUT ?= 1
-STATIC ?= 0
# CROSS COMPILATION SETUP
CROSS ?=
@@ -29,20 +28,20 @@ SRC_DIR := src
FILES := $(filter-out $(BIN_DIR) $(OBJ_DIR), $(wildcard *))
# FLAGS
-COMMONFLAGS :=
-ifneq ($(STATIC), 0)
- COMMONFLAGS += -static
-endif
-ifeq ($(DEBUG),0)
- COMMONFLAGS += -O2
-else
- COMMONFLAGS += -g
+CFLAGS ?=
+LDFLAGS ?=
+
+ifeq ($(DEBUG),1)
+ CFLAGS += -g
endif
-CFLAGS := $(COMMONFLAGS) -Wall `$(PKGCONFIG) json-c --cflags` `$(PKGCONFIG) libarchive --cflags` `$(CURLCONFIG) --cflags`
-LDFLAGS := `$(PKGCONFIG) json-c --libs` `$(PKGCONFIG) libarchive --libs` `$(CURLCONFIG) --libs`
+CFLAGS += -Wall `$(PKGCONFIG) json-c --cflags` `$(PKGCONFIG) libarchive --cflags` `$(CURLCONFIG) --cflags`
+LDFLAGS += `$(PKGCONFIG) json-c --libs` `$(PKGCONFIG) libarchive --libs` `$(CURLCONFIG) --libs`
DEFINES := -DNAME=\"$(NAME)\" -DVERSION=\"$(VERSION)\"
ifeq ($(DEBUG),1)
DEFINES += -DDEBUG
+else
+ # define NDEBUG to prevent assert and similar to cause problems
+ DEFINES += -DNDEBUG
endif
# SOURCE CODE AND OBJECT FILES