Fix buffer stomping; retool Makefile.
The Makefile is now useful for building ke(1) to aid in more rapid development. This works because ke doesn't (yet) need any special non-system libraries.
This commit is contained in:
51
Makefile
51
Makefile
@@ -1,7 +1,36 @@
|
||||
.PHONY: all
|
||||
all:
|
||||
mkdir -p build && cd build && cmake .. && make
|
||||
### 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
|
||||
|
||||
.PHONY: all
|
||||
all: tags trashme $(TARGET)
|
||||
./$(TARGET) trashme.txt
|
||||
|
||||
.PHONY: trashme
|
||||
trashme:
|
||||
cp Makefile trashme.txt
|
||||
|
||||
.PHONY: cmake
|
||||
cmake: build
|
||||
cd build && cmake --config Debug --build ..
|
||||
|
||||
build:
|
||||
mkdir -p build
|
||||
|
||||
# TODO: run these from ./scripts/install-dependencies.sh
|
||||
PHONY: deps
|
||||
deps:
|
||||
sudo apt-get install doxygen scdoc
|
||||
@@ -12,4 +41,20 @@ gui-deps:
|
||||
|
||||
.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) $<
|
||||
|
||||
Reference in New Issue
Block a user