fix: file structure, building to build/
This commit is contained in:
20
Makefile
20
Makefile
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user