2017-10-08 20:06:57 +08:00
|
|
|
CXXFLAGS ?= -O2
|
|
|
|
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
|
2017-10-28 21:12:16 +08:00
|
|
|
headers := XKeyboard.h X11Exception.h
|
|
|
|
sources := XKeyboard.cpp wrapper.cpp
|
|
|
|
objects := $(sources:.cpp=.o)
|
|
|
|
program := xkblayout-state
|
2010-01-03 05:03:23 +08:00
|
|
|
|
2017-10-28 21:12:16 +08:00
|
|
|
all: $(program)
|
2010-01-03 05:03:23 +08:00
|
|
|
|
2017-10-28 21:12:16 +08:00
|
|
|
$(objects): %.o: %.cpp $(headers)
|
2017-10-08 20:06:57 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -Wall -c -o $@ $<
|
2010-01-03 05:03:23 +08:00
|
|
|
|
2017-10-28 21:12:16 +08:00
|
|
|
$(program): $(objects)
|
|
|
|
$(CXX) $(CXXFLAGS) -lX11 $(LDFLAGS) -o $@ $^
|
2010-01-03 05:03:23 +08:00
|
|
|
|
2017-10-08 20:06:57 +08:00
|
|
|
clean:
|
2017-10-28 21:12:16 +08:00
|
|
|
rm -f $(program) $(objects)
|
2010-01-08 04:50:07 +08:00
|
|
|
|
2017-10-28 21:12:16 +08:00
|
|
|
install: $(program)
|
2017-11-27 01:46:13 +08:00
|
|
|
install -D -t $(DESTDIR)$(PREFIX)/bin $(program)
|
2017-10-08 20:06:57 +08:00
|
|
|
|
2010-01-08 04:50:07 +08:00
|
|
|
dist:
|
2017-10-28 21:12:16 +08:00
|
|
|
tar cfa $(program)-v1b.tar.gz Makefile README.md $(headers) $(sources)
|
2010-01-08 04:50:07 +08:00
|
|
|
|