whitespace fixes
[vimprobable2.git] / Makefile
blob7fa386e8837d73e1b81e44bc190e6661c3f56f08
1 TARGET = vimprobable2
3 # Objectfiles, needed for $(TARGET)
4 OBJ = main.o utilities.o callbacks.o
5 # Manpages
6 MAN = vimprobable2.1 vimprobablerc.1
7 # Used libraries to get needed CFLAGS and LDFLAGS form pkg-config
8 LIBS = gtk+-2.0 webkit-1.0 libsoup-2.4
9 # Files to removo by clean target
10 CLEAN = $(TARGET) $(OBJ) $(DEPS) javascript.h
11 # Files to install by install target or remove by uninstall target
12 INSTALL = $(BINDIR)/$(TARGET) $(addprefix $(MANDIR)/man1/,$(MAN))
14 # DEBUG build? Off by default
15 V_DEBUG = 0
17 CFLAGS += `pkg-config --cflags $(LIBS)`
18 LDFLAGS += `pkg-config --libs $(LIBS)` -lX11 -lXext
20 # TA: This is a pretty stringent list of warnings to bail on!
21 ifeq ($(V_DEBUG),1)
22 CFLAGS += -g -ggdb -ansi -Wstrict-prototypes
23 CFLAGS += -Wno-long-long -Wall -Wmissing-declarations
24 endif
26 PREFIX ?= /usr/local
27 BINDIR ?= $(PREFIX)/bin
28 MANDIR ?= $(PREFIX)/share/man
29 # Mode bits for normal not executable files
30 FMOD ?= 0644
31 # Mode bits for directories
32 DMOD ?= 0755
33 # Mode bits for executables
34 EXECMOD ?= 0755
35 # Destination directory to install files
36 DESTDIR ?= /
38 # auto garerated dependancies for object files
39 DEPS = $(OBJ:%.o=%.d)
41 all: $(TARGET)
43 -include $(DEPS)
45 main.o: javascript.h
46 javascript.h: input-focus.js hinting.js
47 perl ./js-merge-helper.pl
49 $(TARGET): $(OBJ)
50 $(CC) $^ $(LDFLAGS) -o $@
52 .PHONY: clean install uninstall
53 clean:
54 -rm -f $(CLEAN)
55 install: $(addprefix $(DESTDIR)/,$(INSTALL))
56 uninstall:
57 rm -f $(INSTALL)
59 # pattern rule to inslall executabels
60 $(DESTDIR)/$(BINDIR)/%: ./%
61 -[ -e '$(@D)' ] || mkdir -p '$(@D)' && chmod $(DMOD) '$(@D)'
62 cp -f '$<' '$@'
63 -strip -s '$@'
64 chmod $(EXECMOD) '$@'
66 # pattern rule to install manpages
67 $(DESTDIR)/$(MANDIR)/man1/%: ./%
68 -[ -e '$(@D)' ] || mkdir -p '$(@D)' && chmod $(DMOD) '$(@D)'
69 cp -f '$<' '$@'
70 chmod $(FMOD) '$@'
72 %.o: %.c
73 $(CC) -MMD -c $(CFLAGS) $< -o $@