summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-01-31 17:16:27 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-01-31 17:16:27 +0300
commit0be032c6998e712dc2c9f2ed97c3491d89eb05af (patch)
treef762d884147d2f0a9a115edd0b5e0de554a3ec1b /Makefile
downloadxift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.tar
xift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.tar.xz
xift-0be032c6998e712dc2c9f2ed97c3491d89eb05af.zip
[xift] Almost done.
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..3cbfb95
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,35 @@
+# Debug mode:
+# DEBUG = yes
+
+CC = g++
+LIB = libxift.a
+
+CPPFLAGS = -Wall -ansi -pedantic
+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