@@ -79,39 +79,61 @@ LIBPATH ?=
7979c_targets := TODO.out
8080
8181
82- # TARGETS #
82+ # RULES #
8383
84- # Default target.
84+ # /
85+ # Compiles C source files.
8586#
86- # This target is the default target.
87-
87+ # @param {string} SOURCE_FILES - list of C source files
88+ # @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop`)
89+ # @param {string} [LIBRARIES] - list of libraries (e.g., `-lpthread -lblas`)
90+ # @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`)
91+ # @param {string} [C_COMPILER] - C compiler
92+ # @param {string} [CFLAGS] - C compiler flags
93+ # @param {(string|void)} [fPIC] - flag indicating whether to generate position independent code
94+ #
95+ # @example
96+ # make
97+ #
98+ # @example
99+ # make all
100+ # /
88101all : $(c_targets )
89102
90103.PHONY : all
91104
92-
93- # Compile C source.
105+ # /
106+ # Compiles C source files .
94107#
95- # This target compiles C source files.
96-
108+ # @private
109+ # @param {string} SOURCE_FILES - list of C source files
110+ # @param {(string|void)} INCLUDE - list of includes (e.g., `-I /foo/bar -I /beep/boop`)
111+ # @param {(string|void)} LIBRARIES - list of libraries (e.g., `-lpthread -lblas`)
112+ # @param {(string|void)} LIBPATH - list of library paths (e.g., `-L /foo/bar -L /beep/boop`)
113+ # @param {string} CC - C compiler
114+ # @param {string} CFLAGS - C compiler flags
115+ # @param {(string|void)} fPIC - flag indicating whether to generate position independent code
116+ # /
97117$(c_targets ) : % .out: % .c
98118 $(QUIET ) $(CC ) $(CFLAGS ) $(fPIC ) $(INCLUDE ) -o $@ $(SOURCE_FILES ) $< $(LIBPATH ) -lm $(LIBRARIES )
99119
100-
101- # Run a benchmark .
120+ # /
121+ # Runs compiled benchmarks .
102122#
103- # This target runs a benchmark.
104-
123+ # @example
124+ # make run
125+ # /
105126run : $(c_targets )
106127 $(QUIET ) ./$<
107128
108129.PHONY : run
109130
110-
111- # Perform clean-up .
131+ # /
132+ # Removes generated files .
112133#
113- # This target removes generated files.
114-
134+ # @example
135+ # make clean
136+ # /
115137clean :
116138 $(QUIET ) -rm -f * .o * .out
117139
0 commit comments