-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
86 lines (72 loc) · 1.71 KB
/
Makefile.in
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
81
82
83
84
85
86
SHELL = /bin/sh
CFLAGS = -g -Wall -std=c99 @PKGS_CFLAGS@ @SYSTEM_CFLAGS@
LDFLAGS = @PKGS_LDFLAGS@ @SYSTEM_LDFLAGS@
prefix = @prefix@
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
datarootdir = $(prefix)/share
mandir = $(datarootdir)/man
INSTALL ?= install
INSTALLFLAGS ?=
SRCS=\
utf8.c \
button.c \
label.c \
layout.c \
statbar.c \
widget.c \
pty.c \
dpy.c \
ptylist.c \
buffer.c \
util.c \
event.c \
xevent.c \
font.c \
color.c \
editor.c \
main.c
PROG=vtsh
OBJS=$(SRCS:.c=.o)
all: fontnames.c fontnames.h colornames.c colornames.h $(PROG)
fontnames.c: mkenum font.enums
@echo $@
@./mkenum impl font <font.enums >$@
fontnames.h: mkenum font.enums
@echo $@
@./mkenum header font <font.enums >$@
colornames.c: mkenum color.enums
@echo $@
@./mkenum impl color <color.enums >$@
colornames.h: mkenum color.enums
@echo $@
@./mkenum header color <color.enums >$@
deps: fontnames.h colornames.h fontnames.c colornames.c
@echo "update: Makefile"
@sed -i '/^# Dependencies/,/^# End dependencies/d' Makefile
@echo "# Dependencies (generated on $$(date))" >>Makefile
@for a in $(SRCS) ; \
do \
$(CC) $(CFLAGS) -MM -MT \
$$(echo $$a | cut -d. -f1).o $$a \
>>Makefile ; \
done >>Makefile
@echo "# End dependencies" >>Makefile
$(PROG): $(OBJS)
@$(CC) -o$@ $(OBJS) $(LDFLAGS)
@echo $@
.c.o:
@$(CC) $(CFLAGS) -c $<
@echo $@
clean:
rm -f $(OBJS) $(PROG)
rm -f fontnames.c fontnames.h colornames.c colornames.h
install: $(PROG)
if [ ! -x $(DESTDIR)$(bindir) ] ; then \
mkdir -p $(DESTDIR)$(bindir) ; fi
$(INSTALL) $(INSTALLFLAGS) $(PROG) $(DESTDIR)$(bindir)
uninstall:
if [ -e $(DESTDIR)$(bindir)/$(PROG) ] ; then \
rm $(DESTDIR)$(bindir)/$(PROG) ; fi
.PHONY: deps