aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-29 19:37:04 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-29 19:37:04 +0100
commit396f61a507c981bab6e26e2eecf5c1eeba2fd565 (patch)
tree1103da84a64bbd42f2c1840c159f38a2d8917a61
downloadminishell-396f61a507c981bab6e26e2eecf5c1eeba2fd565.tar.gz
minishell-396f61a507c981bab6e26e2eecf5c1eeba2fd565.tar.bz2
minishell-396f61a507c981bab6e26e2eecf5c1eeba2fd565.zip
Initial Commit
-rw-r--r--.gitignore4
-rw-r--r--.gitmodules4
-rw-r--r--.travis.yml3
-rw-r--r--Makefile69
-rw-r--r--README.md3
-rw-r--r--include/minishell.h6
m---------libft0
-rw-r--r--src/main.c7
-rw-r--r--subject.pdfbin0 -> 1275144 bytes
-rwxr-xr-xtest.sh12
10 files changed, 108 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b24309c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+minishell
+*.o
+*.ghc
+*.a
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..f47fde7
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "libft"]
+ path = libft
+ url = https://github.com/HappyTramp/libft
+ branch = minishell
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..039216a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,3 @@
+language: c
+
+script: make all && make test
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..dc3a101
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,69 @@
+RM = rm -f
+MAKE = make
+
+TESTEXEC = test.sh
+
+LIBFTDIR = libft
+INCLUDEDIR = include
+SRCDIR = src
+OBJDIR = obj
+
+INCLUDEFILES = minishell.h
+INCLUDE = $(addprefix $(INCLUDEDIR)/, $(INCLUDEFILES))
+
+SRCFILES = main.c
+SRC = $(addprefix $(SRCDIR)/, $(SRCFILES))
+
+OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
+
+CC = gcc
+CCFLAGS = -I$(LIBFTDIR)/include -I$(INCLUDEDIR) -Wall -Wextra #-Werror
+LDFLAGS = -L$(LIBFTDIR) -lft
+
+NAME = minishell
+
+.PHONY: all
+all: libft_all make_obj_dir $(NAME)
+
+.PHONY: test
+test:
+ ./$(TESTEXEC)
+
+.PHONY: make_obj_dir
+make_obj_dir:
+ @if [ ! -d "$(OBJDIR)" ]; then echo "Making object dir"; mkdir $(OBJDIR); fi
+
+$(NAME): $(OBJ)
+ @echo "Linking: $@"
+ $(CC) -o $@ $(OBJ) $(LDFLAGS)
+
+$(OBJDIR)/%.o: $(SRCDIR)/%.c $(INCLUDE)
+ @echo "Compiling: $@"
+ @$(CC) $(CCFLAGS) -c -o $@ $<
+
+.PHONY: clean
+clean: libft_clean
+ @echo "Removing objects"
+ @$(RM) -r $(OBJDIR)
+
+.PHONY: fclean
+fclean: libft_fclean
+ @echo "Removing objects"
+ @$(RM) -r $(OBJDIR)
+ @echo "Removing exectable"
+ @$(RM) $(NAME)
+
+.PHONY: re
+re: fclean all
+
+.PHONY: libft_all
+libft_all:
+ $(MAKE) -C $(LIBFTDIR) all
+
+.PHONY: libft_clean
+libft_clean:
+ $(MAKE) -C $(LIBFTDIR) clean
+
+.PHONY: libft_fclean
+libft_fclean:
+ $(MAKE) -C $(LIBFTDIR) fclean
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2b40b53
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# minishell
+
+minishell project of school 42
diff --git a/include/minishell.h b/include/minishell.h
new file mode 100644
index 0000000..2dc9a38
--- /dev/null
+++ b/include/minishell.h
@@ -0,0 +1,6 @@
+#ifndef MINISHELL_H
+# define MINISHELL_H
+
+# include "libft.h"
+
+#endif
diff --git a/libft b/libft
new file mode 160000
+Subproject fe37597119353ce183fc404417b81bd4702f64b
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..0595106
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,7 @@
+#include "minishell.h"
+
+int main(void)
+{
+ ft_putendl("Hello world");
+ return (0);
+}
diff --git a/subject.pdf b/subject.pdf
new file mode 100644
index 0000000..caeda22
--- /dev/null
+++ b/subject.pdf
Binary files differ
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..f7c072c
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+red() {
+ echo "`tput setaf 1`$1`tput sgr 0`\c"
+ test_status=1
+}
+
+green() {
+ echo "`tput setaf 2`$1`tput sgr 0`\c"
+}
+
+echo "minishell test"