add: src dir

This commit is contained in:
starnakin 2023-06-28 14:34:24 +02:00
parent 051a4eb5be
commit e1b7a5d702
5 changed files with 29 additions and 0 deletions

28
Makefile Normal file
View File

@ -0,0 +1,28 @@
CC = gcc
CFLAGS = -Wall -Wextra -Werror
NAME = zzsh
SRC_DIR = src
OBJ_DIR = obj
SOURCES = $(shell find $(SRC_DIR) -type f -name '*.c')
OBJECTS = $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SOURCES))
DEPS = $(OBJECTS:.o=.d)
all: $(NAME)
$(NAME): $(OBJECTS)
$(CC) $(NAME) $(OBJECTS)
-include $(DEPS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -f $(NAME)
re: fclean $(NAME)

View File

1
src/env/envs.c vendored Normal file
View File

@ -0,0 +1 @@