# # specify all .h files here # H = point.h # # specify all .c files here # C = main.c point.c # # should not have to change anything else below # CC = gcc -std=c11 -pedantic -Wall -g O=$(C:.c=.o) main: $(O) $(CC) $(O) -o main -lm %.o: %.c $(H) $(CC) -c $< clean: rm -f a.out core $(O) main #--- # rules, from the GNU make manual: https://www.gnu.org/software/make/manual/make.html # # target : prerequisites # recipe # # A target is usually the name of a file that is generated by a program. # A prerequisite is a file that is used as input to create the target. # A recipe is an action that make carries out. # # THERE MUST BE A TAB CHARACTER (not spaces) AT THE BEGINNING OF EVERY RECIPE LINE # # otherwise make will fail with an error message like: *** missing separator. Stop. #---