Another Makefile simplification

Object files for executables (as opposed to modules) will now use the .ro
extension; their dependency file is a .rd file. Currently, this affects only
the i2c/eeprom/eeprom program. but in the future, there will be more
executables generated.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@52 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard committed 1998-12-08 23:51:29 +00:00
1 parent 2e4f147647
commit 000b95cce0
3 files changed
+28 -20

No files matched your search

+3 -18
View File
@@ -25,8 +25,9 @@ MODULE_DIR := i2c/eeprom
I2CEEPROMTARGETS := $(MODULE_DIR)/eeprom
I2CEEPROMSOURCES := $(MODULE_DIR)/eeprom.c
# Include all dependency files
INCLUDEFILES += $(I2CEEPROMSOURCES:.c=.d)
# Include all dependency files. We use '.rd' to indicate this will create
# executables.
INCLUDEFILES += $(I2CEEPROMSOURCES:.c=.rd)
all-i2c-eeprom: $(I2CEEPROMTARGETS)
all :: all-i2c-eeprom
@@ -37,19 +38,3 @@ clean-i2c-eeprom:
$(RM) $(I2CEEPROMSOURCES:.c=.d) $(I2CEEPROMSOURCES:.c=.o) \
$(I2CEEPROMTARGETS)
clean :: clean-i2c-eeprom
# The targets
$(MODULE_DIR)/eeprom: $(MODULE_DIR)/eeprom.o
# Oops, we need to use EXCFLAGS instead of CFLAGS... And we have to deal with
# an executable. Ugly code approaching... :-)
$(I2CEEPROMSOURCES:.c=.o):
$(CC) $(EXCFLAGS) -c $(@:.o=.c) -o $@
$(I2CEEPROMSOURCES:.c=.d):
$(CC) -M -MG $(EXCFLAGS) $(@:.d=.c) | \
sed -e \
's@^\(.*\)\.o:@$@ $(@:.d=.o) Makefile '`dirname $@`/Module.mk':@' > $@