-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
80 lines (62 loc) · 2.94 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
74
75
76
77
78
79
80
# Configuration
# -------------
# If you want to override these variables, the recommended way is via the
# configure script. That way, everything gets recompiled automatically.
CFLAGS = -std=c17 -pedantic -Wall -Wextra -O2 -g
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
# Generated by ./configure
include config.mk
# Standard targets
# ----------------
all: xjump misc/xjump.6.gz
clean:
rm -rf ./*.o xjump config.h misc/xjump.6.gz
distclean: clean
rm -rf config.mk
install:
$(INSTALL_PROGRAM) -D xjump $(DESTDIR)$(bindir)/xjump
$(INSTALL_DATA) -D data/font-hs.bmp $(DESTDIR)$(datadir)/xjump/font-hs.bmp
$(INSTALL_DATA) -D data/font-ui.bmp $(DESTDIR)$(datadir)/xjump/font-ui.bmp
$(INSTALL_DATA) -D data/themes/classic.bmp $(DESTDIR)$(datadir)/xjump/themes/classic.bmp
$(INSTALL_DATA) -D data/themes/ion.bmp $(DESTDIR)$(datadir)/xjump/themes/ion.bmp
$(INSTALL_DATA) -D data/themes/jumpnbump.bmp $(DESTDIR)$(datadir)/xjump/themes/jumpnbump.bmp
$(INSTALL_DATA) -D misc/xjump.6.gz $(DESTDIR)$(datadir)/man/man6/xjump.6.gz
$(INSTALL_DATA) -D misc/icon32.png $(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/br.com.gualandi.Xjump.png
$(INSTALL_DATA) -D misc/icon64.png $(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/br.com.gualandi.Xjump.png
$(INSTALL_DATA) -D misc/icon128.png $(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/br.com.gualandi.Xjump.png
$(INSTALL_DATA) -D misc/br.com.gualandi.Xjump.desktop $(DESTDIR)$(datadir)/applications/br.com.gualandi.Xjump.desktop
$(INSTALL_DATA) -D misc/br.com.gualandi.Xjump.metainfo.xml $(DESTDIR)$(datadir)/metainfo/br.com.gualandi.Xjump.metainfo.xml
uninstall:
rm -rf $(DESTDIR)$(bindir)/xjump
rm -rf $(DESTDIR)$(datadir)/xjump
rm -rf $(DESTDIR)$(datadir)/man/man6/xjump.6.gz
rm -rf $(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/br.com.gualandi.Xjump.png
rm -rf $(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/br.com.gualandi.Xjump.png
rm -rf $(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/br.com.gualandi.Xjump.png
rm -rf $(DESTDIR)$(datadir)/applications/br.com.gualandi.Xjump.desktop
rm -rf $(DESTDIR)$(datadir)/metainfo/br.com.gualandi.Xjump.metainfo.xml
.PHONY: all clean distclean install uninstall
# Compilation
# -----------
xjump: xjump.o
$(CC) $(LDFLAGS) $< $(SDL_LIBS) $(LIBS) -o $@
xjump.o: xjump.c config.h
$(CC) $(CPPFLAGS) $(SDL_CFLAGS) $(CFLAGS) -c $< -o $@
config.h: config.mk
@printf "%s" "Generating $@..."
@rm -rf $@
@echo '/* Do not edit this file by hand */' >> $@
@echo '/* It was generated by the build system */' >> $@
@echo '#define XJUMP_VERSION "$(version)"' >> $@
@echo '#define XJUMP_PREFIX "$(prefix)"' >> $@
@echo '#define XJUMP_BINDIR "$(bindir)"' >> $@
@echo '#define XJUMP_DATADIR "$(datadir)"' >> $@
@echo '#define XJUMP_APPNAME "$(appname)"' >> $@
@printf " done\n"
config.mk:
@echo You must run ./configure before make
@exit 1
misc/xjump.6.gz: misc/xjump.6
gzip -c $< > $@