mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-12-23 13:33:04 +02:00
genex/Makefile: add dependency generation (.d method)
Straight from fped/Makefile
This commit is contained in:
parent
41448e8962
commit
40a76e1d4a
@ -9,9 +9,11 @@
|
||||
# (at your option) any later version.
|
||||
#
|
||||
|
||||
CFLAGS = -Wall -g
|
||||
OBJS = genex.o comp.o libs.o pdf.o
|
||||
|
||||
SHELL = /bin/bash
|
||||
CFLAGS = -Wall -g
|
||||
|
||||
CC_normal := $(CC)
|
||||
DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG
|
||||
|
||||
@ -36,8 +38,18 @@ all: genex
|
||||
genex: $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) $*.c -o $*.o
|
||||
$(DEPEND) $*.c | \
|
||||
sed -e \
|
||||
'/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
|
||||
-e '$${g;p;}' -e d >$*.d; \
|
||||
[ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
|
||||
|
||||
-include $(OBJS:.o=.d)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS)
|
||||
rm -f $(OBJS) $(OBJS:.o=.d)
|
||||
|
||||
spotless: clean
|
||||
rm -f genex
|
||||
|
Loading…
Reference in New Issue
Block a user