commit e58fdd591d2d46f6d93ab73773345dbee11f342a Author: Mark Date: Thu Jul 2 18:11:32 2020 +0300 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2c04f8a --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +CC?=$(CROSS_COMPILE)gcc +CFLAGS?=-ggdb \ + -O0 \ + -Wall \ + -Werror +LDFLAGS?=-lgcc + +O=build + +sh_OBJS=$(O)/sh.o + +all: mkdirs $(O)/sh + +mkdirs: + mkdir -p $(O) + +clean: + rm -rf $(O) + +install: $(O)/sh + install -m0755 $(O)/sh $(DESTDIR)/sh + +$(O)/sh: $(sh_OBJS) + $(CC) $(LDFLAGS) -o $@ $(sh_OBJS) + +$(O)/%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< diff --git a/sh.c b/sh.c new file mode 100644 index 0000000..a20c7f4 --- /dev/null +++ b/sh.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("This is a stub\n"); + return 0; +}