i have a makefile/make system that uses gnu make macros;
(here http://mosermichael.github.io/cstuff/all/projects/2011/06/17... )
this saves you from repeating the same make constructs many times over, in the following example you do a static library and executable.
1: TOPDIR=../..
2:
3: # - declare build targets. (built with make)
4: TARGETS:=shlib slibuser
5:
6: # - slib target is a static library -
7: shlib_TYPE=lib
8: shlib_SRC=slib.c
9:
10:
11: # - slibuser target is a executable using slib -
12: slibuser_TYPE=exe
13: slibuser_SRC=slibuser.c slibuser2.c slibuser3.c
14: slibuser_LIBS=shlib
15:
16: include $(TOPDIR)/rules.make