扩展生成文件生成一个库和文档的doxygen [英] Extend the makefile to generate a library and documentation with doxygen

查看:190
本文介绍了扩展生成文件生成一个库和文档的doxygen的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现了一个二叉树方案,其中包括功能的tree.c,与他们的声明和测试一个main.c中的tree.h中。
另外,我有一个makefile是:

I have implemented a binary tree program which includes the tree.c with the functions, the tree.h with the declarations of them and a main.c for testing. Also, I have a makefile which is:

CC=gcc
CFLAGS=-g -Wall
DEPS = tree.h
OBJ = main.o tree.o 

%.o: %.c $(DEPS)
    $(CC) -c -o $@ $< $(CFLAGS)

tree: $(OBJ)
    $(CC) -o $@ $^ $(CFLAGS)

clean:
    rm -f *.o tree

现在我想让它生成一个图书馆不仅是一个目标网络文件为二叉树的功能和事后产生的doxygen的Makefile里的文档。任何帮助将是有益的。

Now I want to make it generate a library not only an object file for the binary trees functions and afterwards to generate the documentation of doxygen inside the makefile. Any help would be helpful.

推荐答案

我知道,我的答案是在一个有点晚,但我希望有人会从中受益。

I know that my answer comes in a bit late, but i hope someone will benefit from this.

我有一个生成的Doxygen文档生成文件。
你必须扭转Doxygen的一点点
创建一个适合您的需要Doxygen的安装文件,然后打开在编辑器中,并删除co​​ntaing以下两个设置的线(它们将被make文件被添加更高版本)

I have a makefile that generates Doxygen doc. You have to twist Doxygen a tiny bit Create the Doxygen setup file that fits Your need, then open that in an editor and remove the lines containg the following two settings (they will be added by the make file later)

INPUT
FILE_PATTERNS

添加此行

@INCLUDE = doxyfile.inc

保存此文件,根据我使用Doxyfile.mk不同的名称

Save this file under a different name I use Doxyfile.mk

在您的Makefile你需要的资源列表以及它们所在的目录
例如:

in You makefile You need a list of sources and the directories where they are located example

SRCS =  $(OBJS:.o=.c)
SRCDIRS = ./src
SRCDIRS += ./other_src

现在你可以把这个规则在Makefile中,它会创建一个包含您从Doxyfile.mk删除的设置文件doxyfile.inc。

Now You can put this rule in the Makefile, it will create the file doxyfile.inc that contains the settings You removed from Doxyfile.mk.

.PHONY: all clean distclean doxy

# If makefile changes, maybe the list of sources has changed, so update doxygens list
doxyfile.inc: Makefile.mk
        echo INPUT         =  $(SRCDIRS) > doxyfile.inc
        echo FILE_PATTERNS =  *.h $(SRCS) >> doxyfile.inc

doxy: doxyfile.inc $(SRCS) 
        doxygen.exe doxyfile.mk

奖金:如果从IDE内部运行像Eclipse的Doxygen的吐出变成可点击的,并会跳转到差评的误差

Bonus: If run from inside an IDE like Eclipse the errors that Doxygen spits out becomes clickable and will jump to the bad comment.

这篇关于扩展生成文件生成一个库和文档的doxygen的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆