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