summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 23 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index df54748c..13b71ac9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,14 @@
+define GNUCASH
+true
+endef
+define HUQUQ
+true
+endef
+
+#
+# Example build: make GNUCASH=1 COMMODITY=EUR
+#
+
CODE = amount.cc \
ledger.cc \
parse.cc \
@@ -8,16 +19,23 @@ CODE = amount.cc \
OBJS = $(patsubst %.cc,%.o,$(CODE))
-CFLAGS = -Wall -ansi -pedantic -DDEFAULT_COMMODITY="\"\$$\""
-CFLAGS := $(CFLAGS) -DHUQUQULLAH=1
+ifndef COMMODITY
+COMMODITY = \$$
+endif
-DFLAGS = -O3 -fomit-frame-pointer
-#DFLAGS = -g -O2 # -pg
+CFLAGS = -Wall -ansi -pedantic
+CFLAGS := $(CFLAGS) -DDEFAULT_COMMODITY="\"$(COMMODITY)\""
-INCS = -I/usr/include/xmltok
+#DFLAGS = -O3 -fomit-frame-pointer
+DFLAGS = -g # -O2 # -pg
+INCS = -I/usr/include/xmltok
LIBS = -lgmpxx -lgmp -lpcre
+ifdef HUQUQ
+CFLAGS := $(CFLAGS) -DHUQUQULLAH=1
+endif
+
ifdef GNUCASH
CODE := $(CODE) gnucash.cc
CFLAGS := $(CFLAGS) -DREAD_GNUCASH=1