From ab7c5b69754081ae30a5af5dde7820cff11276ea Mon Sep 17 00:00:00 2001 From: Louis-Guillaume Gagnon Date: Thu, 12 Dec 2013 12:21:43 -0500 Subject: [PATCH] initial commit --- .gitignore | 1 + Makefile | 15 +++++++++++++++ main.c | 23 +++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5761abc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.o diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0780f66 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +TARGET = sh +CC = gcc +CFLAGS = -O2 -Wall -Wextra -Werror -std=c99 -pedantic -pedantic-errors + +OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) + +$(TARGET): $(OBJS) + $(CC) $(CFLAGS) -o $(TARGET) $(OBJS) + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f *.o + rm -f $(TARGET) diff --git a/main.c b/main.c new file mode 100644 index 0000000..dfe8c24 --- /dev/null +++ b/main.c @@ -0,0 +1,23 @@ +#include +#include + +const char *progname = "sh"; + +static void usage(void); + +/* print usage text */ +void usage(void) +{ + printf("usage: %s [-/+ abCefhimnuvz][-/+ o