kge/Makefile

61 lines
1.3 KiB
Makefile
Raw Normal View History

### 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
all: tags trashme $(TARGET)
./$(TARGET) trashme.txt
.PHONY: trashme
trashme:
cp Makefile trashme.txt
2023-10-09 05:29:47 +00:00
.PHONY: cmake
cmake: build
cd build && cmake --config Debug --build ..
build:
mkdir -p build
# TODO: run these from ./scripts/install-dependencies.sh
PHONY: deps
2023-10-09 05:29:47 +00:00
deps:
sudo apt-get install doxygen scdoc
2023-10-09 05:29:47 +00:00
.PHONY: gui-deps
gui-deps:
sudo apt-get install libfreetype-dev libsdl2-dev libopengl-dev libglfw3-dev
.PHONY:
clean:
rm -f *.o $(TARGET)
tags: $(SOURCES)
ctags --declarations -o $@ $(SOURCES)
ke: $(OBJS)
$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $(OBJS)
.PHONY: cclean
cclean:
rm -r build cmake-build-*
print-%: ; @echo '$(subst ','\'',$*=$($*))'
%.o:%.cc
$(CXX) -c -o $@ $(CXXFLAGS) $<