You can use ./configure to generate the makefiles and then follow stahta01's advice in reply #1
I used ./configure and generated a Makefile in the xboard directory. I created a project in Code::Blocks named xboard_fork . I added some sources which I suppose should be added. After that project>Properties>Project setting :
/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile
 And I enabled the below "This is a custom Makefile."
Now for Rebuild I get:
-------------- Clean: Release in xboard_fork (compiler: LLVM Clang Compiler 9 GTK Library)---------------
Executing clean command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile cleanRelease
make: *** No rule to make target 'cleanRelease'.  Stop.
Error cleaning "xboard_fork - Release"
-------------- Build: Release in xboard_fork (compiler: LLVM Clang Compiler 9 GTK Library)---------------
Checking if target is up-to-date: make -q -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile Release
Running command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile Release
make: *** No rule to make target 'Release'.  Stop.
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
What can I do now ?
			
			
			
				Probably the target name must be changed from "Release" to one of the Makefile targets, choose one (possibly "all") of
	all all-am
	am--refresh check check-am clean clean-aminfo
	clean-binPROGRAMS clean-cscope clean-generic cscope
	cscopelist-am ctags ctags-am dist dist-all dist-bzip2
	dist-gzip dist-info dist-lzip dist-shar dist-tarZ dist-xz
	dist-zip distcheck distclean distclean-compile
	distclean-generic distclean-hdr distclean-tags distcleancheck
	distdir distuninstallcheck dvi dvi-am html html-am info
	info-am install install-ApplicationsDATA install-am
	install-binPROGRAMS install-data install-data-am
	install-data-hook install-dist_iconDATA
	install-dist_pixmapsDATA install-dist_pngDATA
	install-dist_shogiDATA install-dist_soundsDATA
	install-dist_svgDATA install-dist_svgiconDATA
	install-dist_themesDATA install-dist_xiangqiDATA install-dvi
	install-dvi-am install-exec install-exec-am install-html
	install-html-am install-info install-info-am install-man
	install-man6 install-mimeDATA install-pdf install-pdf-am
	install-ps install-ps-am install-strip install-sysconfDATA
	installcheck installcheck-am installdirs installdirs-am
	maintainer-clean maintainer-clean-aminfo
	maintainer-clean-generic maintainer-clean-vti mostlyclean
	mostlyclean-aminfo mostlyclean-compile mostlyclean-generic
	mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall
	uninstall-ApplicationsDATA uninstall-am uninstall-binPROGRAMS
	uninstall-dist_iconDATA uninstall-dist_pixmapsDATA
	uninstall-dist_pngDATA uninstall-dist_shogiDATA
	uninstall-dist_soundsDATA uninstall-dist_svgDATA
	uninstall-dist_svgiconDATA uninstall-dist_themesDATA
	uninstall-dist_xiangqiDATA uninstall-dvi-am uninstall-hook
	uninstall-html-am uninstall-info-am uninstall-man
	uninstall-man6 uninstall-mimeDATA uninstall-pdf-am
	uninstall-ps-am uninstall-sysconfDATA
 
			
			
			
				Probably the target name must be changed from "Release" to one of the Makefile targets, choose one (possibly "all") of
	all all-am
	am--refresh check check-am clean clean-aminfo
	clean-binPROGRAMS clean-cscope clean-generic cscope
	cscopelist-am ctags ctags-am dist dist-all dist-bzip2
	dist-gzip dist-info dist-lzip dist-shar dist-tarZ dist-xz
	dist-zip distcheck distclean distclean-compile
	distclean-generic distclean-hdr distclean-tags distcleancheck
	distdir distuninstallcheck dvi dvi-am html html-am info
	info-am install install-ApplicationsDATA install-am
	install-binPROGRAMS install-data install-data-am
	install-data-hook install-dist_iconDATA
	install-dist_pixmapsDATA install-dist_pngDATA
	install-dist_shogiDATA install-dist_soundsDATA
	install-dist_svgDATA install-dist_svgiconDATA
	install-dist_themesDATA install-dist_xiangqiDATA install-dvi
	install-dvi-am install-exec install-exec-am install-html
	install-html-am install-info install-info-am install-man
	install-man6 install-mimeDATA install-pdf install-pdf-am
	install-ps install-ps-am install-strip install-sysconfDATA
	installcheck installcheck-am installdirs installdirs-am
	maintainer-clean maintainer-clean-aminfo
	maintainer-clean-generic maintainer-clean-vti mostlyclean
	mostlyclean-aminfo mostlyclean-compile mostlyclean-generic
	mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall
	uninstall-ApplicationsDATA uninstall-am uninstall-binPROGRAMS
	uninstall-dist_iconDATA uninstall-dist_pixmapsDATA
	uninstall-dist_pngDATA uninstall-dist_shogiDATA
	uninstall-dist_soundsDATA uninstall-dist_svgDATA
	uninstall-dist_svgiconDATA uninstall-dist_themesDATA
	uninstall-dist_xiangqiDATA uninstall-dvi-am uninstall-hook
	uninstall-html-am uninstall-info-am uninstall-man
	uninstall-man6 uninstall-mimeDATA uninstall-pdf-am
	uninstall-ps-am uninstall-sysconfDATA
I changed target name to "all" now I get :
-------------- Clean: all in xboard_fork (compiler: GNU GCC Compiler)---------------
Executing clean command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile cleanall
make: *** No rule to make target 'cleanall'.  Stop.
Error cleaning "xboard_fork - all"
-------------- Build: all in xboard_fork (compiler: GNU GCC Compiler)---------------
Checking if target is up-to-date: make -q -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
Running command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
make  all-recursive
make[1]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Making all in po
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[1]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 
 
			
			
			
				The "sudo make install" command must be executed (or not) once the "make all" command completes successfully. 
You can call it as a post build step (in Build Options), but will need to specify the password, this should work (I can't test right now):
echo your_password | sudo -S make -f Makefile install
or execute
sudo -S make -f Makefile install
from command line while in folder /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork
			
			
			
				The "sudo make install" command must be executed (or not) once the "make all" command completes successfully. 
You can call it as a post build step (in Build Options), but will need to specify the password, this should work (I can't test right now):
echo your_password | sudo -S make -f Makefile install
[...]
I tried it but I did not get opportunity to enter password :
-------------- Build: all in xboard_fork (compiler: LLVM Clang Compiler 9 GTK Library)---------------
Checking if target is up-to-date: make -q -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
Running command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
make  all-recursive
make[1]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Making all in po
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[1]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Running target post-build steps
echo your_password | sudo -S make -f Makefile install
[sudo] password for mehdi: 
Sorry, try again.
[sudo] password for mehdi: 
sudo: 1 incorrect password attempt
Process terminated with status 1 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))