2014-12-04 11:39:41 -05:00
|
|
|
SOFTWARE_MEANT_FOR_SORTIX=1
|
|
|
|
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 17:38:08 -05:00
|
|
|
CFLAGS?=$(OPTLEVEL)
|
2014-12-04 11:39:41 -05:00
|
|
|
|
|
|
|
CPPFLAGS:=$(CPPFLAGS) -DVERSIONSTR=\"$(VERSION)\"
|
2016-02-28 17:38:08 -05:00
|
|
|
CFLAGS:=$(CFLAGS) -Wall -Wextra
|
2014-12-04 11:39:41 -05:00
|
|
|
|
|
|
|
BINARIES:=sh sortix-sh
|
|
|
|
|
2015-04-02 09:56:33 -04:00
|
|
|
SORTIX_SH_SRCS=\
|
2016-02-28 17:38:08 -05:00
|
|
|
editline.c \
|
|
|
|
sh.c \
|
|
|
|
showline.c \
|
|
|
|
util.c
|
2015-04-02 09:56:33 -04:00
|
|
|
|
2014-12-04 11:39:41 -05:00
|
|
|
all: $(BINARIES)
|
|
|
|
|
|
|
|
.PHONY: all install clean
|
|
|
|
|
|
|
|
install: all
|
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
install $(BINARIES) $(DESTDIR)$(BINDIR)
|
2022-11-16 15:02:57 -05:00
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
|
|
|
cp sh.1 $(DESTDIR)$(MANDIR)/man1/sh.1
|
|
|
|
ln -sf sh.1 $(DESTDIR)$(MANDIR)/man1/sortix-sh.1
|
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man5
|
2022-11-05 19:57:49 -04:00
|
|
|
cp profile.5 $(DESTDIR)$(MANDIR)/man5/profile.5
|
2022-11-16 15:02:57 -05:00
|
|
|
cp proper-sh.5 $(DESTDIR)$(MANDIR)/man5/proper-sh.5
|
2022-11-05 19:57:49 -04:00
|
|
|
cp shrc.5 $(DESTDIR)$(MANDIR)/man5/shrc.5
|
2014-12-04 11:39:41 -05:00
|
|
|
|
2015-04-02 09:56:33 -04:00
|
|
|
sortix-sh: $(SORTIX_SH_SRCS) *.h
|
2016-02-28 17:38:08 -05:00
|
|
|
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $(SORTIX_SH_SRCS) -o $@
|
2014-12-04 11:39:41 -05:00
|
|
|
|
2016-02-28 17:38:08 -05:00
|
|
|
sh: proper-sh.c
|
|
|
|
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $< -o $@
|
2014-12-04 11:39:41 -05:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(BINARIES) *.o
|