Hey everybody!
Having a little problem getting my head around the build rule system in Xcode. Heres a quick overview:
I've written an ANSI C program, a simple HTTP server. Some of the page this web server returns I am currently embedding into the program using the command line tool xxd to generate a header file containing the web page as a char array. Currently, I have to run the command:
xxd -i error.htm webpage_error.h
if I make a change to the html file before building in Xcode. If I forget, I have to rebuild all over again.
I came across some articles online pointing out how easy it was to create a build rule that would execute a bash script when you build. Could some one give me a quick walk through the steps involved in making sure the command line I manually run above runs in the source files folder and includes the newly created header file in the build? I've had a couple of stabs but no luck yet.
(bonus points if the instructions can be applied to any html file, e.g.:
xxd -i (*).htm webpage_$1.h)
Cheers and thanks in advance!
P.S. I'm aware of the sillyness in this: a web server with embedded pages in the source, but there are valid reasons
Having a little problem getting my head around the build rule system in Xcode. Heres a quick overview:
I've written an ANSI C program, a simple HTTP server. Some of the page this web server returns I am currently embedding into the program using the command line tool xxd to generate a header file containing the web page as a char array. Currently, I have to run the command:
xxd -i error.htm webpage_error.h
if I make a change to the html file before building in Xcode. If I forget, I have to rebuild all over again.
I came across some articles online pointing out how easy it was to create a build rule that would execute a bash script when you build. Could some one give me a quick walk through the steps involved in making sure the command line I manually run above runs in the source files folder and includes the newly created header file in the build? I've had a couple of stabs but no luck yet.
(bonus points if the instructions can be applied to any html file, e.g.:
xxd -i (*).htm webpage_$1.h)
Cheers and thanks in advance!
P.S. I'm aware of the sillyness in this: a web server with embedded pages in the source, but there are valid reasons