Changeset 4905
- Timestamp:
- 09/29/07 23:03:32 (1 year ago)
- Files:
-
- i2c-tools/trunk/Makefile (added)
- i2c-tools/trunk/eeprom/Makefile (modified) (2 diffs)
- i2c-tools/trunk/tools/Makefile (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
i2c-tools/trunk/eeprom/Makefile
r4489 r4905 5 5 # Licensed under the GNU Public License. 6 6 7 DESTDIR = 8 prefix = /usr/local 9 bindir = $(prefix)/bin 7 EEPROM_DIR := eeprom 10 8 11 INSTALL := install 12 INSTALL_DIR := $(INSTALL) -m 755 -d 13 INSTALL_PROGRAM := $(INSTALL) -m 755 14 RM := rm -f 15 16 PROGRAMS := decode-dimms.pl decode-vaio.pl ddcmon decode-edid.pl \ 9 EEPROM_TARGETS := decode-dimms.pl decode-vaio.pl ddcmon decode-edid.pl \ 17 10 decode-xeon.pl 18 19 all : $(PROGRAMS)20 11 21 12 # … … 23 14 # 24 15 25 install : install-bin 16 install-eeprom: $(addprefix $(EEPROM_DIR)/,$(EEPROM_TARGETS)) 17 $(INSTALL_DIR) $(DESTDIR)$(bindir) 18 for program in $(EEPROM_TARGETS) ; do \ 19 $(INSTALL_PROGRAM) $(EEPROM_DIR)/$$program $(DESTDIR)$(bindir) ; done 26 20 27 uninstall : uninstall-bin 28 29 install-bin : $(PROGRAMS) 30 $(INSTALL_DIR) $(DESTDIR)$(bindir) 31 for program in $(PROGRAMS) ; do \ 32 $(INSTALL_PROGRAM) $$program $(DESTDIR)$(bindir) ; done 33 34 uninstall-bin : 35 for program in $(PROGRAMS) ; do \ 21 uninstall-eeprom: 22 for program in $(EEPROM_TARGETS) ; do \ 36 23 $(RM) $(DESTDIR)$(bindir)/$$program ; done 37 24 38 clean : 25 install: install-eeprom 26 27 uninstall: uninstall-eeprom i2c-tools/trunk/tools/Makefile
r4499 r4905 5 5 # Licensed under the GNU Public License. 6 6 7 CC = gcc 8 CFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \ 9 -Wcast-align -Wwrite-strings -Wnested-externs -Winline -W \ 10 -Wundef -Wmissing-prototypes -I../include 7 TOOLS_DIR := tools 11 8 12 CFLAGS += -O2 13 # When debugging, use the following instead 14 #CFLAGS += -O -g 9 TOOLS_CFLAGS := -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \ 10 -Wcast-align -Wwrite-strings -Wnested-externs -Winline \ 11 -W -Wundef -Wmissing-prototypes -I../include 15 12 16 # Pass linker flags here 17 LDFLAGS = 18 19 DESTDIR = 20 prefix = /usr/local 21 sbindir = $(prefix)/sbin 22 mandir = $(prefix)/share/man 23 man8dir = $(mandir)/man8 24 25 INSTALL := install 26 INSTALL_DATA := $(INSTALL) -m 644 27 INSTALL_DIR := $(INSTALL) -m 755 -d 28 INSTALL_PROGRAM := $(INSTALL) -m 755 29 RM := rm -f 30 31 PROGRAMS := i2cdetect i2cdump i2cset i2cget 32 33 all : $(PROGRAMS) 13 TOOLS_TARGETS := i2cdetect i2cdump i2cset i2cget 34 14 35 15 # … … 37 17 # 38 18 39 i2cdetect : i2cdetect.oi2cbusses.o19 $(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o 40 20 $(CC) $(LDFLAGS) -o $@ $^ 41 21 42 i2cdump : i2cdump.o i2cbusses.outil.o22 $(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o 43 23 $(CC) $(LDFLAGS) -o $@ $^ 44 24 45 i2cset : i2cget.o i2cbusses.outil.o25 $(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o 46 26 $(CC) $(LDFLAGS) -o $@ $^ 47 27 48 i2cget : i2cset.o i2cbusses.outil.o28 $(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o 49 29 $(CC) $(LDFLAGS) -o $@ $^ 50 30 … … 53 33 # 54 34 55 i2cdetect.o : i2cdetect.ci2cbusses.h56 $(CC) $(CFLAGS) -c $< -o $@35 $(TOOLS_DIR)/i2cdetect.o: $(TOOLS_DIR)/i2cdetect.c $(TOOLS_DIR)/i2cbusses.h 36 $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 57 37 58 i2cdump.o : i2cdump.c i2cbusses.hutil.h59 $(CC) $(CFLAGS) -c $< -o $@38 $(TOOLS_DIR)/i2cdump.o: $(TOOLS_DIR)/i2cdump.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h 39 $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 60 40 61 i2cset.o : i2cset.c i2cbusses.hutil.h62 $(CC) $(CFLAGS) -c $< -o $@41 $(TOOLS_DIR)/i2cset.o: $(TOOLS_DIR)/i2cset.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h 42 $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 63 43 64 i2cget.o : i2cget.c i2cbusses.hutil.h65 $(CC) $(CFLAGS) -c $< -o $@44 $(TOOLS_DIR)/i2cget.o: $(TOOLS_DIR)/i2cget.c $(TOOLS_DIR)/i2cbusses.h $(TOOLS_DIR)/util.h 45 $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 66 46 67 i2cbusses.o : i2cbusses.ci2cbusses.h68 $(CC) $(CFLAGS) -c $< -o $@47 $(TOOLS_DIR)/i2cbusses.o: $(TOOLS_DIR)/i2cbusses.c $(TOOLS_DIR)/i2cbusses.h 48 $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 69 49 70 util.o : util.cutil.h71 $(CC) $(CFLAGS) -c $< -o $@50 $(TOOLS_DIR)/util.o: $(TOOLS_DIR)/util.c $(TOOLS_DIR)/util.h 51 $(CC) $(CFLAGS) $(TOOLS_CFLAGS) -c $< -o $@ 72 52 73 53 # … … 75 55 # 76 56 77 strip : $(PROGRAMS) 78 strip $(PROGRAMS) 57 all-tools: $(addprefix $(TOOLS_DIR)/,$(TOOLS_TARGETS)) 79 58 80 install : install-bin install-man 59 strip-tools: $(addprefix $(TOOLS_DIR)/,$(TOOLS_TARGETS)) 60 strip $(addprefix $(TOOLS_DIR)/,$(TOOLS_TARGETS)) 81 61 82 uninstall : uninstall-bin uninstall-man 62 clean-tools: 63 $(RM) $(addprefix $(TOOLS_DIR)/,*.o $(TOOLS_TARGETS)) 83 64 84 install-bin : $(PROGRAMS) 85 $(INSTALL_DIR) $(DESTDIR)$(sbindir) 86 for program in $(PROGRAMS) ; do \ 87 $(INSTALL_PROGRAM) $$program $(DESTDIR)$(sbindir) ; done 65 install-tools: $(addprefix $(TOOLS_DIR)/,$(TOOLS_TARGETS)) 66 $(INSTALL_DIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir) 67 for program in $(TOOLS_TARGETS) ; do \ 68 $(INSTALL_PROGRAM) $(TOOLS_DIR)/$$program $(DESTDIR)$(sbindir) ; \ 69 $(INSTALL_DATA) $(TOOLS_DIR)/$$program.8 $(DESTDIR)$(man8dir) ; done 88 70 89 uninstall-bin : 90 for program in $(PROGRAMS) ; do \ 91 $(RM) $(DESTDIR)$(sbindir)/$$program ; done 92 93 install-man : 94 $(INSTALL_DIR) $(DESTDIR)$(man8dir) 95 for program in $(PROGRAMS) ; do \ 96 $(INSTALL_DATA) $$program.8 $(DESTDIR)$(man8dir) ; done 97 98 uninstall-man : 99 for program in $(PROGRAMS) ; do \ 71 uninstall-tools: 72 for program in $(TOOLS_TARGETS) ; do \ 73 $(RM) $(DESTDIR)$(sbindir)/$$program ; \ 100 74 $(RM) $(DESTDIR)$(man8dir)/$$program.8 ; done 101 75 102 clean : 103 $(RM) *.o $(PROGRAMS) core 76 all: all-tools 77 78 strip: strip-tools 79 80 clean: clean-tools 81 82 install: install-tools 83 84 uninstall: uninstall-tools
