-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (34 loc) · 1007 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
VERSION=0.0.1
CXX = g++
CPPFLAGS=-DVERSION=\"${VERSION}\" -D_GNU_SOURCE
CXXFLAGS = -Wall -g -O2 -std=c++11
PREFIX?=/usr/local
MANDIR?=$(PREFIX)/share/man
DATADIR?=$(PREFIX)/share/doc
BINDIR?=$(PREFIX)/bin
DEBUGGER?=
INSTALL=install
INSTALL_PROGRAM=$(INSTALL)
INSTALL_DATA=${INSTALL} -m 644
LIBS = -lcurses
OBJECTS=src/xs.o src/io.o src/misc.o src/ui.o
all: xscore
xscore: $(OBJECTS)
$(CXX) $(CXXFLAGS) $(CCFLAGS) -o $@ $(OBJECTS) $(LIBS)
%.o: %.c config.h
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
shell:
echo 'source /usr/local/share/doc/xs/examples/xs-bash.sh' >> ~/.bashrc
install: xscore
mkdir -p $(DESTDIR)$(BINDIR)
cp xscore $(DESTDIR)$(BINDIR)/
chmod 755 ${DESTDIR}${BINDIR}/xscore
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp doc/xs.1 $(DESTDIR)$(MANDIR)/man1/
chmod 644 ${DESTDIR}${MANDIR}/man1/xs.1
mkdir -p $(DATADIR)/xs/examples/
cp shell/xs-bash.sh $(DATADIR)/xs/examples/
chmod 755 $(DATADIR)/xs/examples/xs-bash.sh
clean:
rm -f xscore src/*.o
.PHONY: all clean install shell