| 1 | #Copyright (C) 2007 L. Donnie Smith |
|---|
| 2 | |
|---|
| 3 | include @top_builddir@/defs.mak |
|---|
| 4 | |
|---|
| 5 | APP_NAME = wminput |
|---|
| 6 | |
|---|
| 7 | SOURCES = main.c conf.c c_plugin.c uinput.c action_enum.c util.c |
|---|
| 8 | #kludge to make sure YACC/LEX sources are listed last, otherwise we get errors |
|---|
| 9 | #when building dependencies |
|---|
| 10 | LAST_SOURCES = parser.c lexer.c |
|---|
| 11 | |
|---|
| 12 | WMINPUT_CONFIG_DIR = $(CWIID_CONFIG_DIR)/wminput |
|---|
| 13 | CFLAGS += -I@top_builddir@/libcwiid \ |
|---|
| 14 | -DWMINPUT_CONFIG_DIR=\"$(WMINPUT_CONFIG_DIR)\" \ |
|---|
| 15 | -DCWIID_PLUGINS_DIR=\"$(CWIID_PLUGINS_DIR)\" |
|---|
| 16 | |
|---|
| 17 | LDLIBS += -lcwiid -lbluetooth -ldl -lpthread |
|---|
| 18 | LDFLAGS += -L@top_builddir@/libcwiid -rdynamic |
|---|
| 19 | INST_DIR = @bindir@ |
|---|
| 20 | |
|---|
| 21 | YFLAGS += -d |
|---|
| 22 | |
|---|
| 23 | ifdef PYTHON |
|---|
| 24 | SOURCES += py_plugin.c |
|---|
| 25 | CFLAGS += -I/usr/include/python@PYTHON_VERSION@ |
|---|
| 26 | LDLIBS += -lpython@PYTHON_VERSION@ |
|---|
| 27 | endif |
|---|
| 28 | |
|---|
| 29 | SOURCES += $(LAST_SOURCES) |
|---|
| 30 | |
|---|
| 31 | include $(COMMON)/include/app.mak |
|---|
| 32 | |
|---|
| 33 | all install clean distclean uninstall: make_plugins |
|---|
| 34 | |
|---|
| 35 | install: install_configs |
|---|
| 36 | |
|---|
| 37 | #DON'T UNINSTALL CONFIGS |
|---|
| 38 | #uninstall: uninstall_configs |
|---|
| 39 | |
|---|
| 40 | make_plugins: |
|---|
| 41 | $(MAKE) $(MAKECMDGOALS) -C plugins |
|---|
| 42 | |
|---|
| 43 | install_configs: |
|---|
| 44 | install -d $(WMINPUT_CONFIG_DIR) |
|---|
| 45 | install configs/* $(WMINPUT_CONFIG_DIR) |
|---|
| 46 | ln -sf acc_led $(WMINPUT_CONFIG_DIR)/default |
|---|
| 47 | |
|---|
| 48 | #uninstall_configs: |
|---|
| 49 | # rm -f $(WMINPUT_CONFIG_DIR)/default |
|---|
| 50 | # for c in `ls configs`; do \ |
|---|
| 51 | # rm -f $(WMINPUT_CONFIG_DIR)/$$c; \ |
|---|
| 52 | # done |
|---|
| 53 | # rmdir $(WMINPUT_CONFIG_DIR); true |
|---|
| 54 | |
|---|
| 55 | action_enum.c: action_enum.awk action_enum.txt |
|---|
| 56 | $(AWK) -f action_enum.awk action_enum.txt > action_enum.c |
|---|
| 57 | |
|---|
| 58 | conf.o lexer.c: y.tab.h |
|---|
| 59 | |
|---|
| 60 | y.tab.h: parser.c |
|---|
| 61 | |
|---|
| 62 | clean: clean_gen |
|---|
| 63 | |
|---|
| 64 | clean_gen: |
|---|
| 65 | rm -f action_enum.c parser.c lexer.c y.tab.h |
|---|
| 66 | |
|---|
| 67 | distclean: clean |
|---|
| 68 | rm Makefile |
|---|
| 69 | |
|---|
| 70 | .PHONY: all install clean distclean uninstall make_plugins clean_gen |
|---|