Asmblue/Makefile
Arthur POULET c30c496b07
Properly handle "call"
This change shows I understand how the frame is working and why it
must be used this way. Save and restore rbp being key.
2023-05-30 00:15:09 +02:00

40 lines
605 B
Makefile

NAME = output
SRCS = exercice.S
OBJS = $(SRCS:.S=.o)
NASM = nasm
CC = gcc
LD = ld
NASMFLAGS = -f elf64 -g
# CFLAGS =
LDLIBS = -lc -lglfw -lGL
LDFLAGS = -m elf_x86_64 --dynamic-linker=/lib64/ld-linux-x86-64.so.2 $(LDLIBS)
RM = rm -f
all: $(NAME)
run: all
$(NAME)
$(NAME): $(OBJS)
@echo -e "linking $@"
$(LD) $(LDFLAGS) -o $(NAME) $(OBJS)
@echo -e "$(NAME) is compiled"
%.o: %.S
@echo -e "compiling object $@"
$(NASM) $(NASMFLAGS) -o $@ $<
%.o: %.c
$(CC) $(CFLAGS) -o $@ $<
clean:
$(RM) $(OBJS)
fclean: clean
$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re