2021-08-06 22:28:20 -04:00
|
|
|
# Makefile -- µEMACS
|
|
|
|
# Copyright © 2013-2021 Renaud Fivet
|
2005-05-31 11:50:56 -04:00
|
|
|
|
2010-02-26 13:48:56 -05:00
|
|
|
# Make the build silent by default
|
|
|
|
V =
|
|
|
|
|
|
|
|
ifeq ($(strip $(V)),)
|
|
|
|
E = @echo
|
|
|
|
Q = @
|
|
|
|
else
|
|
|
|
E = @\#
|
|
|
|
Q =
|
|
|
|
endif
|
|
|
|
export E Q
|
|
|
|
|
2013-05-16 21:21:59 -04:00
|
|
|
PROGRAM=ue
|
2010-08-29 06:08:13 -04:00
|
|
|
|
2005-05-31 11:50:56 -04:00
|
|
|
CC=gcc
|
2020-06-16 02:09:44 -04:00
|
|
|
WARNINGS=-pedantic -Wall -Wextra -Wstrict-prototypes -Wno-unused-parameter
|
2010-02-27 05:38:24 -05:00
|
|
|
CFLAGS=-O2 $(WARNINGS)
|
2021-02-22 22:30:28 -05:00
|
|
|
LDFLAGS=-s
|
2020-11-01 22:31:24 -05:00
|
|
|
LIBS=-lcurses
|
2021-08-18 04:54:35 -04:00
|
|
|
DEFINES=-DPROGRAM=$(PROGRAM) -D_GNU_SOURCE # -DNDEBUG
|
2020-10-30 02:12:45 -04:00
|
|
|
|
2005-05-31 11:50:56 -04:00
|
|
|
BINDIR=/usr/bin
|
|
|
|
LIBDIR=/usr/lib
|
|
|
|
|
2021-07-13 22:10:58 -04:00
|
|
|
SRCS = $(sort $(wildcard *.c))
|
|
|
|
OBJS = $(SRCS:.c=.o)
|
|
|
|
|
|
|
|
$(PROGRAM): $(OBJS)
|
2010-02-26 13:48:56 -05:00
|
|
|
$(E) " LINK " $@
|
2021-07-13 22:10:58 -04:00
|
|
|
$(Q) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
2005-05-31 11:50:56 -04:00
|
|
|
|
|
|
|
clean:
|
2010-02-26 13:48:56 -05:00
|
|
|
$(E) " CLEAN"
|
2021-08-06 22:28:20 -04:00
|
|
|
$(Q) rm -f $(PROGRAM) depend.mak *.o
|
2005-05-31 11:50:56 -04:00
|
|
|
|
2010-08-29 06:08:13 -04:00
|
|
|
install: $(PROGRAM)
|
|
|
|
strip $(PROGRAM)
|
2013-05-16 21:21:59 -04:00
|
|
|
cp $(PROGRAM) ${BINDIR}
|
2005-05-31 11:50:56 -04:00
|
|
|
cp emacs.hlp ${LIBDIR}
|
|
|
|
cp emacs.rc ${LIBDIR}/.emacsrc
|
2013-05-16 21:21:59 -04:00
|
|
|
chmod 755 ${BINDIR}/$(PROGRAM)
|
2005-05-31 11:50:56 -04:00
|
|
|
chmod 644 ${LIBDIR}/emacs.hlp ${LIBDIR}/.emacsrc
|
|
|
|
|
|
|
|
.c.o:
|
2010-02-26 13:48:56 -05:00
|
|
|
$(E) " CC " $@
|
|
|
|
$(Q) ${CC} ${CFLAGS} ${DEFINES} -c $*.c
|
2005-05-31 11:50:56 -04:00
|
|
|
|
2021-07-16 00:24:13 -04:00
|
|
|
depend.mak: $(wildcard *.h)
|
2021-07-13 22:10:58 -04:00
|
|
|
$(E) " DEPEND"
|
2021-07-16 00:24:13 -04:00
|
|
|
$(Q) $(CC) $(DEFINES) -MM $(SRCS) > depend.mak
|
2021-07-13 22:10:58 -04:00
|
|
|
|
|
|
|
include depend.mak
|
|
|
|
|
|
|
|
# end of Makefile
|