File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 1+ # Usage: make [all/clean/oclean/fclean] -f [file]
12
23
34CC = gcc
45SRC = main.c school.c
5- OBJ = ${ SRC:% .c=%.o}
6+ OBJ = $( SRC:.c=.o)
67NAME = school
7- CFLAGS = -Wall -Werror _Wextra -pedantic
8+ CFLAGS = -Wall -Werror -Wextra -pedantic
89
10+ # standard rule to say rules below are not filenames
911.PHONY: all clean oclean fclean re
1012
11- all: m.h ${OBJ}
12- ${CC} ${OBJ} -o ${NAME}
13+ # makes executable
14+ all: m.h $(OBJ)
15+ $(CC) $(OBJ) -o $(NAME)
1316
17+ # deletes tmp files & executable
1418clean:
15- ${RM} *~ ${ NAME}
19+ $(RM) *~ $( NAME)
1620
17- fclean:
18- ${RM} *${OBJ}
21+ # deletes object files
22+ oclean:
23+ $(RM) $(OBJ)
1924
25+ # deletes all (tmp files, executable, & obj files)
2026fclean: clean oclean
2127
22- re: fclean all
28+ # deletes all & recompiles all source files
29+ re: oclean all
You can’t perform that action at this time.
0 commit comments