2023-10-12 22:15:09 +00:00
|
|
|
### quick Makefile to build ke in the top-level. It will never be used
|
|
|
|
### kge; ke doesn't use any non-system libraries. vim, emacs, and joe
|
|
|
|
### all support building from a Makefile in the root directory of the
|
|
|
|
### project, so it's useful to quickly test builds when editing remote.
|
|
|
|
CC := clang
|
|
|
|
CXX := clang++
|
|
|
|
CXXFLAGS := -Werror -Wall -Wextra -g -fsanitize=address -std=c++17
|
|
|
|
LDFLAGS :=
|
|
|
|
|
|
|
|
SOURCES := Buffer.cc Buffer.h \
|
|
|
|
Cursor.cc Cursor.h \
|
|
|
|
Defs.cc Defs.h \
|
|
|
|
File.cc File.h \
|
|
|
|
main.cc
|
|
|
|
OBJS := $(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES)))
|
|
|
|
TARGET := ke
|
|
|
|
|
2023-10-09 05:29:47 +00:00
|
|
|
.PHONY: all
|
2023-10-12 22:15:09 +00:00
|
|
|
all: tags trashme $(TARGET)
|
|
|
|
./$(TARGET) trashme.txt
|
|
|
|
|
|
|
|
.PHONY: trashme
|
|
|
|
trashme:
|
|
|
|
cp Makefile trashme.txt
|
2023-10-09 05:29:47 +00:00
|
|
|
|
2023-10-12 22:15:09 +00:00
|
|
|
.PHONY: cmake
|
|
|
|
cmake: build
|
|
|
|
cd build && cmake --config Debug --build ..
|
|
|
|
|
|
|
|
build:
|
|
|
|
mkdir -p build
|
|
|
|
|
|
|
|
# TODO: run these from ./scripts/install-dependencies.sh
|
2023-10-11 21:50:35 +00:00
|
|
|
PHONY: deps
|
2023-10-09 05:29:47 +00:00
|
|
|
deps:
|
2023-10-11 21:50:35 +00:00
|
|
|
sudo apt-get install doxygen scdoc
|
2023-10-09 05:29:47 +00:00
|
|
|
|
2023-10-11 21:50:35 +00:00
|
|
|
.PHONY: gui-deps
|
|
|
|
gui-deps:
|
|
|
|
sudo apt-get install libfreetype-dev libsdl2-dev libopengl-dev libglfw3-dev
|
|
|
|
|
|
|
|
.PHONY:
|
|
|
|
clean:
|
2023-10-12 22:15:09 +00:00
|
|
|
rm -f *.o $(TARGET)
|
|
|
|
|
|
|
|
tags: $(SOURCES)
|
|
|
|
ctags --declarations -o $@ $(SOURCES)
|
|
|
|
|
|
|
|
ke: $(OBJS)
|
|
|
|
$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(OBJS)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: cclean
|
|
|
|
cclean:
|
2023-10-11 21:50:35 +00:00
|
|
|
rm -r build cmake-build-*
|
2023-10-12 22:15:09 +00:00
|
|
|
|
|
|
|
print-%: ; @echo '$(subst ','\'',$*=$($*))'
|
|
|
|
|
|
|
|
%.o:%.cc
|
|
|
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|