Backspace sends DEL instead of ^H.
[spft.git] / Makefile
blobdf9102c5a07fee766ba8962d751e6662b2554136
1 PROGRAM := spft
2 OBJECTS_DIR := objects
3 CFLAGS += -Wall
4 X11_TOP := /usr/X11R6
6 -include Makefile.local
8 SOURCES := TermWindow.cpp Terminal.cpp History.cpp Line.cpp Run.cpp
9 SOURCES += Settings.cpp UTF8.cpp Colors.cpp FontSet.cpp main.cpp
11 OBJECTS = $(foreach source,$(SOURCES),$(OBJECTS_DIR)/$(source:.cpp=.o))
12 OBJECTS_SUBDIRS = $(foreach dir,$(SUBDIRS),$(OBJECTS_DIR)/$(dir))
14 ifndef VERBOSE_MAKE
15 QUIET := @
16 endif
18 all: $(PROGRAM)
20 X11_INCLUDES := $(X11_TOP)/include
21 X11_LIBS := $(X11_TOP)/lib
23 CPP := g++
24 CFLAGS += -MMD
25 CFLAGS += -g
26 CFLAGS += $(foreach switch,$(SWITCHES),-D$(switch))
28 CFLAGS += -std=c++11 -I$(X11_INCLUDES) `pkg-config --cflags fontconfig`
29 LINK_FLAGS += -L$(X11_LIBS) -lX11 -lXft -lutil `pkg-config --libs fontconfig`
31 $(OBJECTS_DIR)/%.o: %.cpp
32 @echo Compiling $<...
33 $(QUIET) $(CPP) -c $< -g $(CFLAGS) -o $@
35 $(OBJECTS): | $(OBJECTS_DIR)
37 $(PROGRAM): $(OBJECTS)
38 @echo "Linking $@..."
39 $(QUIET) $(CPP) $(filter-out $(OBJECTS_DIR),$^) -g $(LINK_FLAGS) -o $@
40 @echo "---------------------------------------------"
41 @echo
43 $(OBJECTS_DIR):
44 @echo "Making $@..."
45 $(QUIET) mkdir -p $(OBJECTS_DIR) $(OBJECTS_SUBDIRS)
47 -include $(OBJECTS_DIR)/*.d
50 .PHONY: runnit
51 runnit: $(PROGRAM)
52 @./$(PROGRAM) $(RUN_ARGS)
54 .PHONY: clean
55 clean:
56 rm -rf $(OBJECTS_DIR)
58 .PHONY: tags
59 tags:
60 ctags -R .