-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
58 lines (45 loc) · 999 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
47
48
49
50
51
52
53
54
55
56
57
58
# Makefile -- µEMACS
# Copyright © 2013-2022 Renaud Fivet
# Make the build silent by default
V =
ifeq ($(strip $(V)),)
E = @echo
Q = @
else
E = @\#
Q =
endif
export E Q
PROGRAM=ue
CC=cc
WARNINGS=-pedantic -Wall -Wextra -Wstrict-prototypes -Wno-unused-parameter
CFLAGS=-O2 $(WARNINGS)
LDFLAGS=-s
LIBS=-lcurses
DEFINES=-DPROGRAM=$(PROGRAM) -D_GNU_SOURCE # -DNDEBUG
BINDIR=/usr/bin
LIBDIR=/usr/lib
SRCS = $(sort $(wildcard *.c))
$(PROGRAM): $(SRCS:.c=.o)
$(E) " LINK " $@
$(Q) $(CC) $(LDFLAGS) -o $@ $+ $(LIBS)
clean:
$(E) " CLEAN"
$(Q) rm -f $(PROGRAM) *.dep *.o
install: $(PROGRAM)
strip $(PROGRAM)
cp $(PROGRAM) ${BINDIR}
cp emacs.hlp ${LIBDIR}
cp emacs.rc ${LIBDIR}/.emacsrc
chmod 755 ${BINDIR}/$(PROGRAM)
chmod 644 ${LIBDIR}/emacs.hlp ${LIBDIR}/.emacsrc
.c.o:
$(E) " CC " $@
$(Q) $(CC) $(CFLAGS) $(DEFINES) -c $*.c
%.dep: %.c
$(E) " DEPEND" $@
$(Q) $(CC) $(DEFINES) -MM $< > $@
ifneq ($(MAKECMDGOALS),clean)
include $(SRCS:.c=.dep)
endif
# end of Makefile