In Bash:
HEADER=all_headers.h
echo "#ifndef __ALL_HEADERS__" > $HEADER
echo "#define __ALL_HEADERS__" >> $HEADER
for file in dir/*.h
do
echo "#include <$file>" >> $HEADER
done
echo "#endif" >> $HEADER
More Related Contents:
- What is the difference between #include and #include “filename”?
- C/C++, can you #include a file into a string literal? [duplicate]
- Can the C preprocessor be used to tell if a file exists?
- When can you omit the file extension in an #include directive?
- Is the backslash acceptable in C and C++ #include directives?
- Difference between using std::vector and include<vector>
- Why are #ifndef and #define used in C++ header files?
- Comma in C/C++ macro
- Detecting superfluous #includes in C/C++?
- __FILE__, __LINE__, and __FUNCTION__ usage in C++
- Eclipse CDT: Symbol ‘cout’ could not be resolved
- MSVC++ variadic macro expansion
- How should I detect unnecessary #include files in a large C++ project?
- Multi line preprocessor macros
- Should I use #define, enum or const?
- Is it a good idea to wrap an #include in a namespace block?
- C++ preprocessor: avoid code repetition of member variable list
- How to use Macro argument as string literal?
- How to make a variadic macro for std::cout?
- How do I get a list of files in a directory in C++? [duplicate]
- Are there any macros to determine if my code is being compiled to Windows? [duplicate]
- Concat two `const char` string literals
- cmath vs math.h (And similar c-prefixed vs .h extension headers)
- What is a good reference documenting patterns of use of X-Macros in C (or possibly C++)?
- What does ## in a #define mean?
- How do I temporarily disable a macro expansion in C/C++?
- How can I see the output of the Visual C++ preprocessor? [duplicate]
- Expand macro inside string literal
- Do you know tool building tree of include files in project\file?
- #ifdef vs #if – which is better/safer as a method for enabling/disabling compilation of particular sections of code?