2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 13:57:41 +00:00

Introduced automatic dependencies within Makefiles.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard
1998-11-03 01:32:55 +00:00
parent a001ba2b96
commit f90c552823
2 changed files with 13 additions and 1 deletions

View File

@@ -62,6 +62,9 @@ endif
.PHONY: all clean install version package
# Make all the default rule
all::
# Include all makefiles for sub-modules
include $(patsubst %,%/Module.mk,$(MODULES))
@@ -73,6 +76,12 @@ install::
clean::
$(RM) lm_sensors-*
# Create a dependency file. Tricky.
%.d: %.c
gcc -M -MG $(CFLAGS) $< | \
sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' > $@
# This is tricky, but it works like a charm. It needs lots of utilities
# though: cut, find, gzip, ln, tail and tar.
package: version clean

View File

@@ -7,6 +7,9 @@ TARGETS := $(MODULE_DIR)/i2c-core.o $(MODULE_DIR)/algo-bit.o \
$(MODULE_DIR)/i2c-dev.o $(MODULE_DIR)/bit-lp.o \
$(MODULE_DIR)/bit-velle.o $(MODULE_DIR)/bit-mb.o
# Include all dependency files
include $(TARGETS:.o=.d)
all :: $(TARGETS)
install :: $(TARGETS)
@@ -14,4 +17,4 @@ install :: $(TARGETS)
install -o root -g root -m 644 $(MODDIR) $(TARGETS)
clean ::
$(RM) $(TARGETS)
$(RM) $(TARGETS) $(TARGETS:.o=.d)