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