summary refs log tree commit diff
path: root/bin/1sh/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'bin/1sh/Makefile')
-rw-r--r--bin/1sh/Makefile91
1 files changed, 91 insertions, 0 deletions
diff --git a/bin/1sh/Makefile b/bin/1sh/Makefile
new file mode 100644
index 00000000..ad85a46a
--- /dev/null
+++ b/bin/1sh/Makefile
@@ -0,0 +1,91 @@
+PREFIX = /usr/local
+MANDIR = $(PREFIX)/share/man
+
+CFLAGS += -std=c99 -Wall -Wextra -DSHELL -Ilibedit
+LDLIBS = -lcurses
+
+-include config.mk
+
+SRCS += alias.c
+SRCS += arith_yacc.c
+SRCS += arith_yylex.c
+SRCS += cd.c
+SRCS += echo.c
+SRCS += error.c
+SRCS += eval.c
+SRCS += exec.c
+SRCS += expand.c
+SRCS += histedit.c
+SRCS += input.c
+SRCS += jobs.c
+SRCS += kill.c
+SRCS += mail.c
+SRCS += main.c
+SRCS += memalloc.c
+SRCS += miscbltin.c
+SRCS += mystring.c
+SRCS += options.c
+SRCS += output.c
+SRCS += parser.c
+SRCS += printf.c
+SRCS += redir.c
+SRCS += show.c
+SRCS += test.c
+SRCS += trap.c
+SRCS += var.c
+
+GENSRCS = builtins.c nodes.c syntax.c
+GENHDRS = builtins.h nodes.h syntax.h token.h
+
+SRCS += $(GENSRCS)
+OBJS = $(SRCS:.c=.o) libedit/libedit.a
+
+MAN1 = 1sh.1 1sh-kill.1 1sh-printf.1 1sh-test.1
+
+all: tags 1sh
+
+1sh: $(OBJS)
+	$(CC) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@
+
+$(OBJS): $(GENHDRS)
+
+libedit/libedit.a:
+	$(MAKE) -C libedit libedit.a
+
+builtins.c builtins.h: mkbuiltins builtins.def
+	sh mkbuiltins .
+
+nodes.c nodes.h: mknodes nodetypes nodes.c.pat
+	./mknodes nodetypes nodes.c.pat
+
+syntax.c syntax.h: mksyntax
+	./mksyntax
+
+token.h: mktokens
+	sh mktokens
+
+tags: *.h *.c
+	ctags -w *.h *.c
+
+depend: $(SRCS) $(GENHDRS)
+	$(CC) $(CFLAGS) -MM $(SRCS) > .depend
+
+-include .depend
+
+clean:
+	rm -f 1sh $(OBJS) mknodes mksyntax $(GENSRCS) $(GENHDRS) tags .depend
+
+install: 1sh $(MAN1)
+	install -d $(PREFIX)/bin $(MANDIR)/man1
+	install 1sh $(PREFIX)/bin
+	install -m 644 $(MAN1) $(MANDIR)/man1
+
+uninstall:
+	rm -f $(PREFIX)/bin/1sh $(MAN1:%=$(MANDIR)/man1/%)
+
+shell:
+	grep -q '^$(PREFIX)/bin/1sh$$' /etc/shells \
+		|| echo '$(PREFIX)/bin/1sh' >> /etc/shells
+
+unshell:
+	sed -i sed '\;^$(PREFIX)/bin/1sh$$;d' /etc/shells
a35d4ee9ffae94cc5bc9096c9f7f54a&follow=1'>ui-shared: restrict to 15 levelsJason A. Donenfeld 2019-02-23ui-diff,ui-tag: don't use htmlf with non-formatted stringsChris Mayo 2019-02-23ui-ssdiff: resolve HTML5 validation errorsChris Mayo 2019-01-03filters: migrate from luacrypto to luaosslJason A. Donenfeld 2019-01-02ui-shared: fix broken sizeof in title setting and rewriteJason A. Donenfeld 2018-12-09git: update to v2.20.0Christian Hesse 2018-11-25ui-blame: set repo for sbJason A. Donenfeld 2018-11-25auth-filter: pass url with query string attachedJason A. Donenfeld 2018-11-21git: use xz compressed archive for downloadChristian Hesse 2018-10-12git: update to v2.19.1Christian Hesse 2018-09-11ui-ssdiff: ban strcat()Christian Hesse 2018-09-11ui-ssdiff: ban strncpy()Christian Hesse 2018-09-11ui-shared: ban strcat()Christian Hesse 2018-09-11ui-patch: ban sprintf()Christian Hesse 2018-09-11ui-log: ban strncpy()Christian Hesse 2018-09-11ui-log: ban strcpy()Christian Hesse 2018-09-11parsing: ban sprintf()Christian Hesse 2018-09-11parsing: ban strncpy()Christian Hesse 2018-08-28filters: generate anchor links from markdownChristian Hesse 2018-08-03Bump version.Jason A. Donenfeld 2018-08-03clone: fix directory traversalJason A. Donenfeld 2018-08-03config: record repo.snapshot-prefix in the per-repo configKonstantin Ryabitsev