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