If you have a globals header file you can have something like
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#ifdef ALLOCATE_GLOBALS
#define GLOBAL_PREFIX
#define GLOBAL_VAL(x) = x
#else
#define GLOBAL_PREFIX extern
#define GLOBAL_VAL(x)
#endif
#endif /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */
GLOBAL_PREFIX const char *G_NAME_S GLOBAL_VAL ("name");
GLOBAL_PREFIX int g_log_level GLOBAL_VAL (1);
then in one of the c source files have
#define ALLOCATE_GLOBALS (1)
before the
#include "globals.h"
line in that particular file and it will define and declare the variables just fine