Skip to content

Commit

Permalink
Added in a Makefile target for making the documentation.
Browse files Browse the repository at this point in the history
This also will open up the HTML documetnation in firefox. Also, the
Doxygen configuration file was renamed to the library's name.
  • Loading branch information
bperez77 committed Aug 18, 2016
1 parent 3eb78ee commit 8c01646
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
30 changes: 22 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,25 @@ GLOBAL_CFLAGS = -Wall -Wextra -Werror -std=gnu99
# The location where the compiled executables and driver will be stored
OUTPUT_DIR ?= outputs

# The location where the generated documentation files are stored
DOC_DIR = docs

################################################################################
# Targets
################################################################################

# None of the targets correspond to actual files
.PHONY: all debug clean cross_compiler_check help
.PHONY: all debug docs clean cross_compiler_check help

# Compile the examples and driver in release mode as the default target
# Compile the driver, library, and examples in release mode as the default
all: driver library examples

# Compile the driver and examples in debug mode
# Compile the driver, library, and examples in debug mode
debug: driver_debug library_debug examples_debug

# Generate the doxygen documentation for library
docs: library_docs

# Include the specific targets for the examples, library, and driver (the
# includes must go here, so the default target is 'all')
include library/Makefile
Expand Down Expand Up @@ -70,18 +76,21 @@ help:
@printf "\n"
@printf "Targets:\n"
@printf "\tall (default)\n"
@printf "\t The default target. Compiles both the examples and driver.\n"
@printf "\t The default target. Compiles all components.\n"
@printf "\n"
@printf "\tdebug\n"
@printf "\t Compiles both the examples and driver in debug mode.\n"
@printf "\t Compiles all components in their debug modes.\n"
@printf "\n"
@printf "\tdocs\n"
@printf "\t Generates the Doxygen documentation all of the components.\n"
@printf "\n"
@printf "\tclean\n"
@printf "\t Cleans up all intermediate files generated by compilation\n"
@printf "\t of the driver and example programs.\n"
@printf "\n"
@printf "\tdriver\n"
@printf "\t Compiles the AXI DMA driver. The kernel object file can be\n"
@printf "\t found at \$$(OUTPUT_DIR)/axidma.ko.\n"
@printf "\t found at '\$$(OUTPUT_DIR)/axidma.ko'.\n"
@printf "\n"
@printf "\tdriver_debug\n"
@printf "\t Compiles the AXI DMA driver in debug mode.\n"
Expand All @@ -91,19 +100,24 @@ help:
@printf "\n"
@printf "\tlibrary\n"
@printf "\t Compiles the AXI DMA library. The shared library file can\n"
@printf "\t be found at \$$(OUTPUT_DIR)/libaxidma.so.\n"
@printf "\t be found at '\$$(OUTPUT_DIR)/libaxidma.so'.\n"
@printf "\n"
@printf "\tlibrary_debug\n"
@printf "\t Compiles the library in debug mode. This enables debugging\n"
@printf "\t symbols for GDB and compiles the library with -O0.\n"
@printf "\n"
@printf "\tlibrary_docs\n"
@printf "\t Generates the Doxygen documentation for the library as\n"
@printf "\t both as HTML and Latex. These can be found under 'docs'.\n"
@printf "\t Also, opens the HTML documentation in firefox.\n"
@printf "\n"
@printf "\tlibrary_clean\n"
@printf "\t Cleans up the files generated by compiling the library.\n"
@printf "\n"
@printf "\texamples, <example_name>\n"
@printf "\t Compiles the example programs or specific example program.\n"
@printf "\t The executable for a given example can be found at\n"
@printf "\t \$$(OUTPUT_DIR)/<example name>.\n"
@printf "\t '\$$(OUTPUT_DIR)/<example name>'.\n"
@printf "\n"
@printf "\texamples_debug, <example_name>_debug\n"
@printf "\t Compiles the example programs or a specific example\n"
Expand Down
File renamed without changes.
11 changes: 10 additions & 1 deletion library/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ LIBAXIDMA_NAME = axidma
LIBAXIDMA_LIBRARY = $(LIBAXIDMA_DIR)/lib$(LIBAXIDMA_NAME).so
LIBAXIDMA_OUTPUT_LIBRARY = $(OUTPUT_DIR)/lib$(LIBAXIDMA_NAME).so

# The Doxygen configuration file and generated libaxidma documentation file
LIBAXIDMA_DOC_CONFIG = libaxidma.dox
LIBAXIDMA_DOC = $(DOC_DIR)/html/index.html

################################################################################
# Targets
################################################################################

.PHONY: library library_debug library_clean
.PHONY: library library_debug library_docs library_clean

# User-facing targets for compiling the driver with and without debug mode
library library_debug: $(LIBAXIDMA_OUTPUT_LIBRARY)
Expand All @@ -51,6 +55,11 @@ $(LIBAXIDMA_LIBRARY): $(LIBAXIDMA) $(LIBAXIDMA_INC) | cross_compiler_check
$(LIBAXIDMA_OUTPUT_LIBRARY): $(LIBAXIDMA_LIBRARY) $(OUTPUT_DIR)
@cp $< $@

# Geneate the Doxygen documentation for the library
library_docs:
doxygen $(LIBAXIDMA_DOC_CONFIG) &> /dev/null
firefox $(LIBAXIDMA_DOC) &

# Clean up all the files generated by compiling the library
library_clean:
rm -f $(LIBAXIDMA_OUTPUT_LIBRARY) $(LIBAXIDMA_LIBRARY)
Expand Down

0 comments on commit 8c01646

Please sign in to comment.