summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2019-10-16 19:34:47 +0300
committerAleksey Veresov <aleksey@veresov.pro>2019-10-16 19:34:47 +0300
commit7b09f265c1deb12c9e6778c4d92473d66fc5406b (patch)
treed8103c5ed176899524913697aa0356d93a107d38 /Makefile
parent77f503bd6db90bd882e389ea977f02a2773e14f2 (diff)
downloadtexo-7b09f265c1deb12c9e6778c4d92473d66fc5406b.tar
texo-7b09f265c1deb12c9e6778c4d92473d66fc5406b.tar.xz
texo-7b09f265c1deb12c9e6778c4d92473d66fc5406b.zip
[texo] Starting rewriting...
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..09a764d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+# Debug mode:
+# DEBUG = yes
+
+CC = g++
+LIB = libtexo.a
+
+CPPFLAGS = -Wall -ansi
+ifeq '$(DEBUG)' 'yes'
+CPPFLAGS += -g -O0
+else
+CPPFLAGS += -O3
+endif
+
+SRC_DIR = src
+SRC = $(wildcard $(SRC_DIR)/*.cpp)
+OBJ = $(SRC:.cpp=.o)
+
+
+default: $(LIB)
+
+ifneq "clean" "$(MAKECMDGOALS)"
+-include deps.mk
+endif
+
+deps.mk: $(SRC)
+ $(CC) -MM $^ > $@
+
+%.o: %.cpp %.hpp
+ $(CC) $(CPPFLAGS) -c $< -o $@
+
+$(LIB): $(OBJ)
+ ar rcs $@ $^
+
+clean:
+ rm -f $(OBJ) $(LIB) deps.mk