diff options
author | 2009-09-16 14:25:13 -0700 | |
---|---|---|
committer | 2010-03-28 17:51:36 -0700 | |
commit | 4ad6779b132efeff0a68a650393ac2ef1fa601b2 (patch) | |
tree | 6c27b3f3e342c1892a67accbd7712ee5eaf8024f | |
parent | Ignore the alloc_size attribute. (diff) | |
download | sparse-4ad6779b132efeff0a68a650393ac2ef1fa601b2.tar.gz sparse-4ad6779b132efeff0a68a650393ac2ef1fa601b2.tar.bz2 sparse-4ad6779b132efeff0a68a650393ac2ef1fa601b2.zip |
Simplify Makefile using static pattern rules
I find a way to get rid of the macro and $$ in linking
executable program.
Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r-- | Makefile | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -115,14 +115,9 @@ sparse.pc: sparse.pc.in compile_EXTRA_DEPS = compile-i386.o -PROG_LINK_CMD = $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $^ $($@_EXTRA_OBJS) - -define BUILD_PROGRAM -$(prog): $(prog).o $$($(prog)_EXTRA_DEPS) $$(LIBS) - $$(PROG_LINK_CMD) -endef - -$(foreach prog,$(PROGRAMS),$(eval $(BUILD_PROGRAM))) +$(foreach p,$(PROGRAMS),$(eval $(p): $($(p)_EXTRA_DEPS) $(LIBS))) +$(PROGRAMS): % : %.o + $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $^ $($@_EXTRA_OBJS) $(LIB_FILE): $(LIB_OBJS) $(QUIET_AR)$(AR) rcs $@ $(LIB_OBJS) |