Changeset 52
- Timestamp:
- 12/09/98 00:51:29 (14 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 3 modified
-
Makefile (modified) (3 diffs)
-
doc/makefiles (modified) (1 diff)
-
i2c/eeprom/Module.mk (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/Makefile
r23 r52 8 8 # 9 9 # This program is distributed in the hope that it will be useful, 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of10 # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 12 # GNU General Public License for more details. … … 138 138 $(CC) -M -MG $(CFLAGS) $< | \ 139 139 sed -e 's@^\(.*\)\.o:@$*.d $*.o Makefile '`dirname $*.d`/Module.mk':@' > $@ 140 140 141 141 142 142 # This is tricky, but it works like a charm. It needs lots of utilities … … 160 160 echo -n 'Version: '; \ 161 161 echo '#define LM_VERSION "'`read VER; echo $$VER`\" >> version.h 162 163 # .ro files are used for programs (as opposed to modules) 164 %.ro: %.c 165 $(CC) $(EXCFLAGS) -c $< -o $@ 166 167 %: %.ro 168 $(CC) $(EXLDFLAGS) -o $@ $^ 169 170 %.rd: %.c 171 $(CC) -M -MG $(CFLAGS) $< | \ 172 sed -e 's@^\(.*\)\.o:@$*.rd $*.ro Makefile '`dirname $*.rd`/Module.mk':@' > $@ 173 -
lm-sensors/trunk/doc/makefiles
r19 r52 51 51 only output more information, and never make the code mis-behave. 52 52 53 Several files are generated by Makefiles: 54 * .d 55 Dependency files for modules. Automatically generated. 56 * .rd 57 Dependency files for executables. Automatically generated. 58 * .ro 59 Object files for executables. They will be linked together to create 60 the executable. This extension is used to distinguish them from 61 modules (which end on .o). Also, using a different extensions makes 62 the Makefile fragments much simpler. 63 53 64 There are lots of comments within the main Makefile. Please read them if 54 65 you want to know more. -
lm-sensors/trunk/i2c/eeprom/Module.mk
r19 r52 26 26 I2CEEPROMSOURCES := $(MODULE_DIR)/eeprom.c 27 27 28 # Include all dependency files 29 INCLUDEFILES += $(I2CEEPROMSOURCES:.c=.d) 28 # Include all dependency files. We use '.rd' to indicate this will create 29 # executables. 30 INCLUDEFILES += $(I2CEEPROMSOURCES:.c=.rd) 30 31 31 32 all-i2c-eeprom: $(I2CEEPROMTARGETS) … … 38 39 $(I2CEEPROMTARGETS) 39 40 clean :: clean-i2c-eeprom 40 41 # The targets42 $(MODULE_DIR)/eeprom: $(MODULE_DIR)/eeprom.o43 44 45 # Oops, we need to use EXCFLAGS instead of CFLAGS... And we have to deal with46 # an executable. Ugly code approaching... :-)47 48 $(I2CEEPROMSOURCES:.c=.o):49 $(CC) $(EXCFLAGS) -c $(@:.o=.c) -o $@50 51 $(I2CEEPROMSOURCES:.c=.d):52 $(CC) -M -MG $(EXCFLAGS) $(@:.d=.c) | \53 sed -e \54 's@^\(.*\)\.o:@$@ $(@:.d=.o) Makefile '`dirname $@`/Module.mk':@' > $@55
