fix: file structure, building to build/

This commit is contained in:
2024-01-18 16:05:56 +01:00
parent a97fde9f86
commit 2ca86229d5
10 changed files with 10 additions and 10 deletions

View File

@@ -1,8 +1,8 @@
SRC = pasm.c \ SRC = src/pasm.c \
file_utils.c \ src/file_utils.c \
interpreter_states.c \ src/interpreter_states.c \
instructions.c \ src/instructions.c \
api.c src/api.c
OBJ = $(SRC:.c=.o) OBJ = $(SRC:.c=.o)
NAME = pasm NAME = pasm
CFLAGS = -Wall -Wextra -Wpedantic -Iinclude CFLAGS = -Wall -Wextra -Wpedantic -Iinclude
@@ -11,13 +11,14 @@ CLIBS =
all: $(NAME) all: $(NAME)
lib: $(OBJ) lib: $(OBJ)
ar rc lib$(NAME).a $(OBJ) mkdir build
ar rc build/lib$(NAME).a $(OBJ)
$(NAME): fclean $(NAME): fclean
$(NAME): lib $(NAME): lib
$(NAME): CLIBS += lib$(NAME).a $(NAME): CLIBS += build/lib$(NAME).a
$(NAME): $(NAME):
gcc tests/interpreter.c $(CFLAGS) $(CLIBS) -o $(NAME) gcc tests/interpreter.c $(CFLAGS) $(CLIBS) -o build/$(NAME)
interpreter: $(NAME) interpreter: $(NAME)
@@ -30,8 +31,7 @@ clean:
cd tests && $(MAKE) clean cd tests && $(MAKE) clean
fclean: clean fclean: clean
rm -f $(NAME) rm -rf build/
find . -name "lib$(NAME).a" -delete
cd tests && $(MAKE) fclean cd tests && $(MAKE) fclean
re: fclean re: fclean

View File

View File

View File