2014-08-23 15:26:38 -04:00
|
|
|
include ../build-aux/platform.mak
|
|
|
|
include ../build-aux/compiler.mak
|
|
|
|
include ../build-aux/version.mak
|
|
|
|
include ../build-aux/dirs.mak
|
|
|
|
|
|
|
|
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
|
2016-02-28 11:36:45 -05:00
|
|
|
CFLAGS?=$(OPTLEVEL)
|
2014-08-23 15:26:38 -04:00
|
|
|
|
2016-02-28 11:36:45 -05:00
|
|
|
CFLAGS:=$(CFLAGS) -Wall -Wextra
|
2014-08-23 15:26:38 -04:00
|
|
|
|
2014-07-27 19:30:50 -04:00
|
|
|
ifeq ($(HOST_IS_SORTIX),0)
|
|
|
|
CPPFLAGS+=-D_GNU_SOURCE
|
|
|
|
endif
|
|
|
|
|
2014-08-23 15:26:38 -04:00
|
|
|
BINARY=editor
|
|
|
|
|
|
|
|
OBJS=\
|
|
|
|
command.o \
|
|
|
|
cursor.o \
|
|
|
|
display.o \
|
|
|
|
editor.o \
|
|
|
|
highlight.o \
|
|
|
|
input.o \
|
|
|
|
modal.o \
|
|
|
|
multibyte.o \
|
|
|
|
terminal.o \
|
|
|
|
|
|
|
|
all: $(BINARY)
|
|
|
|
|
|
|
|
.PHONY: all install clean
|
|
|
|
|
|
|
|
$(BINARY): $(OBJS)
|
2016-02-28 11:36:45 -05:00
|
|
|
$(CC) $(CFLAGS) $(OBJS) -o $(BINARY) $(LIBS)
|
2014-08-23 15:26:38 -04:00
|
|
|
|
2016-02-28 11:36:45 -05:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
2014-08-23 15:26:38 -04:00
|
|
|
|
|
|
|
install: all
|
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
install $(BINARY) $(DESTDIR)$(BINDIR)
|
2016-02-03 13:39:37 -05:00
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
2016-02-28 19:35:13 -05:00
|
|
|
cp editor.1 $(DESTDIR)$(MANDIR)/man1/editor.1
|
2016-01-01 10:01:39 -05:00
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man5
|
2016-02-28 19:35:13 -05:00
|
|
|
cp editor.5 $(DESTDIR)$(MANDIR)/man5/editor.5
|
2014-08-23 15:26:38 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(BINARY) $(OBJS) *.o
|