-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
73 lines (59 loc) · 1.79 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
TARGET = vimprobable2
# Objectfiles, needed for $(TARGET)
OBJ = main.o utilities.o callbacks.o
# Manpages
MAN = vimprobable2.1 vimprobablerc.1
# Used libraries to get needed CFLAGS and LDFLAGS form pkg-config
LIBS = gtk+-2.0 webkit-1.0 libsoup-2.4
# Files to removo by clean target
CLEAN = $(TARGET) $(OBJ) $(DEPS) javascript.h
# Files to install by install target or remove by uninstall target
INSTALL = $(BINDIR)/$(TARGET) $(addprefix $(MANDIR)/man1/,$(MAN))
# DEBUG build? Off by default
V_DEBUG = 0
CFLAGS += `pkg-config --cflags $(LIBS)`
LDFLAGS += `pkg-config --libs $(LIBS)` -lX11 -lXext
# TA: This is a pretty stringent list of warnings to bail on!
ifeq ($(V_DEBUG),1)
CFLAGS += -g -ggdb -ansi -Wstrict-prototypes
CFLAGS += -Wno-long-long -Wall -Wmissing-declarations
endif
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
# Mode bits for normal not executable files
FMOD ?= 0644
# Mode bits for directories
DMOD ?= 0755
# Mode bits for executables
EXECMOD ?= 0755
# Destination directory to install files
DESTDIR ?= /
# auto garerated dependancies for object files
DEPS = $(OBJ:%.o=%.d)
all: $(TARGET)
-include $(DEPS)
main.o: javascript.h
javascript.h: input-focus.js hinting.js
perl ./js-merge-helper.pl
$(TARGET): $(OBJ)
$(CC) $^ $(LDFLAGS) -o $@
.PHONY: clean install uninstall
clean:
-rm -f $(CLEAN)
install: $(addprefix $(DESTDIR)/,$(INSTALL))
uninstall:
rm -f $(INSTALL)
# pattern rule to inslall executabels
$(DESTDIR)/$(BINDIR)/%: ./%
-[ -e '$(@D)' ] || mkdir -p '$(@D)' && chmod $(DMOD) '$(@D)'
cp -f '$<' '$@'
-strip -s '$@'
chmod $(EXECMOD) '$@'
# pattern rule to install manpages
$(DESTDIR)/$(MANDIR)/man1/%: ./%
-[ -e '$(@D)' ] || mkdir -p '$(@D)' && chmod $(DMOD) '$(@D)'
cp -f '$<' '$@'
chmod $(FMOD) '$@'
%.o: %.c
$(CC) -MMD -c $(CFLAGS) $< -o $@