-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile
46 lines (34 loc) · 948 Bytes
/
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
include config.mk
CC=gcc
SRC=$(wildcard *.c)
OBJS=$(patsubst %.c,%.o,$(SRC))
HEADERS=$(wildcard *.h)
ICONS=$(wildcard icons/*.png)
XPMS=$(patsubst icons/%.png,icons/%.xpm,$(ICONS))
FONTS=$(wildcard fonts/*.otf)
FONTS_H=$(patsubst fonts/%.otf,fonts/%.h,$(FONTS))
PREFIX := /usr/local
# require gnumake
icons/%.xpm: icons/%.png
convert $< $@
fonts/%.h: fonts/%.otf
xxd -i $< > $@
%.o: %.c $(HEADERS) config.mk
$(CC) -c $(CFLAGS) -o $@ $<
bin/classic-colors: $(XPMS) $(FONTS_H) $(OBJS)
mkdir -p bin
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
.PHONY: install
install: bin/classic-colors
install -d "$(PREFIX)/bin/"
install -m 755 bin/classic-colors "$(PREFIX)/bin/classic-colors"
install -d "${PREFIX}/share/classic-colors/help/"
install -m 0644 -t "${PREFIX}/share/classic-colors/help" help/*
.PHONY: clean
clean:
rm -f bin/classic-colors
rm -f *.o
.PHONY: clean-icons
clean-icons:
rm -f fonts/*.h
rm -f icons/*.xpm