initial commit
This commit is contained in:
commit
f1dc8fe9f4
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
obj/*
|
||||
seyshell
|
||||
27
Makefile
Normal file
27
Makefile
Normal file
@ -0,0 +1,27 @@
|
||||
NAME := seyshell
|
||||
CC := gcc
|
||||
CFLAGS := -Wall -Wextra -Werror -g
|
||||
OBJ_DIR := obj
|
||||
SRC_DIR := src
|
||||
|
||||
SOURCES := $(shell find $(SRC_DIR) -name "*.c")
|
||||
OBJECTS := $(SOURCES:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
$(NAME): $(OBJECTS)
|
||||
@$(CC) $(CFLAGS) $(OBJECTS) -o $(NAME)
|
||||
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
|
||||
@mkdir -p $(dir $@)
|
||||
@$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
@rm -rf $(OBJ_DIR)
|
||||
|
||||
fclean: clean
|
||||
@rm -f $(NAME)
|
||||
|
||||
re: fclean all
|
||||
|
||||
.PHONY: all clean fclean re
|
||||
8
src/main.c
Normal file
8
src/main.c
Normal file
@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[], char *envp[]) {
|
||||
int index = 0;
|
||||
while (envp[index]) {
|
||||
printf("%s\n", envp[index++]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user