[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Makefile - how to filter out x.c files that do not have correspondin
From: |
hzmonte |
Subject: |
Re: Makefile - how to filter out x.c files that do not have corresponding x.h in a rule that has %.h as prerequisite |
Date: |
13 Jan 2006 09:22:11 -0800 |
User-agent: |
G2/0.2 |
I found out there is a thread "optional prerequisite" in
help-make@gnu.org on Aug 31, 2005 that says it cannot be done.
I ended up doing this:
$(NO_H_OBJ) =prog3.o prog4.o
$(NO_H_OBJ): %.o %.c
$(CC) -c $< -o $@
$(filter-out $(NO_H_OBJ), $(OBJ)): %.o: %.c %.h
$(CC) -c $< -o $@
Still, is there a better way?