fix: file structure, building to build/
This commit is contained in:
20
Makefile
20
Makefile
@@ -1,8 +1,8 @@
|
||||
SRC = pasm.c \
|
||||
file_utils.c \
|
||||
interpreter_states.c \
|
||||
instructions.c \
|
||||
api.c
|
||||
SRC = src/pasm.c \
|
||||
src/file_utils.c \
|
||||
src/interpreter_states.c \
|
||||
src/instructions.c \
|
||||
src/api.c
|
||||
OBJ = $(SRC:.c=.o)
|
||||
NAME = pasm
|
||||
CFLAGS = -Wall -Wextra -Wpedantic -Iinclude
|
||||
@@ -11,13 +11,14 @@ CLIBS =
|
||||
all: $(NAME)
|
||||
|
||||
lib: $(OBJ)
|
||||
ar rc lib$(NAME).a $(OBJ)
|
||||
mkdir build
|
||||
ar rc build/lib$(NAME).a $(OBJ)
|
||||
|
||||
$(NAME): fclean
|
||||
$(NAME): lib
|
||||
$(NAME): CLIBS += lib$(NAME).a
|
||||
$(NAME): CLIBS += build/lib$(NAME).a
|
||||
$(NAME):
|
||||
gcc tests/interpreter.c $(CFLAGS) $(CLIBS) -o $(NAME)
|
||||
gcc tests/interpreter.c $(CFLAGS) $(CLIBS) -o build/$(NAME)
|
||||
|
||||
interpreter: $(NAME)
|
||||
|
||||
@@ -30,8 +31,7 @@ clean:
|
||||
cd tests && $(MAKE) clean
|
||||
|
||||
fclean: clean
|
||||
rm -f $(NAME)
|
||||
find . -name "lib$(NAME).a" -delete
|
||||
rm -rf build/
|
||||
cd tests && $(MAKE) fclean
|
||||
|
||||
re: fclean
|
||||
|
||||
Reference in New Issue
Block a user