Makefiles:
Some good tutorials can be found by googling - I'm not telling you to RTFM/STFW, but maybe you looked at makefiles a long time ago, because I know when I made my first makefile, there wasn't many good tutorials
indexed by google at the time.
An example, simple (don't be scared off! Makefiles are actually quite simple!) makefile I made myself looks like this:
# Build everything; just calls make...
all: game.c editor.c tiles.h # will do it if any these files have changed since last build
echo Making editor and game with default platform
make game
make editor
# Build the game
game: game.c vars.h defines.h menu.h funcs.h funcdefs.h tiles.h structs.h stats.h # if none of these have changed, exit
echo Making game for default platform
g++ game.c -o game -lSDL -lSDL_ttf -lSDL_image -Wall -Wno-unused-result -O3 # Compile the program with the GNU C++ Compiler, producing the system-native (for me it's x86_64) binary 'game' with the SDL, SDL_ttf and SDL_image libraries. All warnings except no-unused-result are turned on. A level 3 optimisation is enabled.
# Build the editor
editor: editor.c menu.h tiles.h # again, these must have changed or make will exit
echo Making editor for default platform
g++ editor.c -o editor -lSDL -lSDL_ttf -lSDL_image -Wall -Wno-unused-result -O3 # Compile the program, producing the binary 'editor', much like the above
Hope this helps! There are also variables, it all works much like a (ba)sh script. Personally I do not use variables- but I probably should.
If you want, you COULD write a (ba)sh script instead!
Code::blocks allows you to specify your own makefile, don't know about other editors. IDEs honestly complicate stuff too much, if it wasn't for the AWESOME autocompletion(Code::blocks will follow #includes, Geany will not), I'd go back to using Nano and/or Geany and makefiles (which I often use anyway).