I've done some research on this issue and have included -lm at the end of my list of tags, but I keep getting an undefined reference to ____ with several math functions like cos and sin. Edit: I included <math.h>,<stdlib.h>,<stdio.h>
CFLAGS= -std=gnu18 -Wall -Wextra -Who-unused -pedantic -g -O3 -lm
CC=gcc
PROGRAMS=main
LIBS=libct.a
OBJECTS= mex.o count.o id.o orag.o
all: $(PROGRAMS) $(LIBS)
libct.a: $(OBJECTS)
ar rcs $@ $^
main: main.o $(OBJECTS)
%.o: %.c
$$(CC) $(CFLAGS) -c -o $@ $<
%: %.o
$$(CC) $(CFLAGS) -o $@ $^
.PHONY:clean_objects clean all
clean_objects:
rm -f *.o
clean:
rm -f $(PROGRAMS) $(LIBS) *.o