-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 693 Bytes
/
Makefile
File metadata and controls
36 lines (28 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SRC = src/pasm.c \
src/file_utils.c \
src/interpreter_states.c \
src/instructions.c \
src/api.c \
src/debug.c \
src/libc.c
OBJ = $(SRC:.c=.o)
NAME = pasm
CC = gcc
CFLAGS = -Wall -Wextra -Wpedantic -Iinclude -s -Os -fno-ident -fno-asynchronous-unwind-tables
CLIBS = -lm
all: $(NAME)
lib: $(OBJ)
@mkdir -p build
ar rc build/lib$(NAME).a $(OBJ)
$(NAME): lib
$(CC) $(CFLAGS) -o build/$(NAME) tests/interpreter.c build/lib$(NAME).a $(CLIBS)
interpreter: $(NAME)
clean:
@rm -f $(OBJ)
@cd tests && $(MAKE) clean
fclean: clean
@rm -rf build/
@cd tests && $(MAKE) fclean
re: fclean
re: $(NAME)
.PHONY: all $(NAME) clean fclean re interpreter lib