blob: fcaf72f22ad605f3edf7e88d0c8eff0841b4202d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# EEPROMER
#
# Licensed under the GNU General Public License.
EEPROMER_DIR := eepromer
EEPROMER_CFLAGS := -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
-Wcast-align -Wwrite-strings -Wnested-externs -Winline \
-W -Wundef -Wmissing-prototypes -Iinclude
EEPROMER_TARGETS := eepromer eeprom eeprog
#
# Programs
#
$(EEPROMER_DIR)/eepromer: $(EEPROMER_DIR)/eepromer.o
$(CC) $(LDFLAGS) -o $@ $^
$(EEPROMER_DIR)/eeprom: $(EEPROMER_DIR)/eeprom.o
$(CC) $(LDFLAGS) -o $@ $^
$(EEPROMER_DIR)/eeprog: $(EEPROMER_DIR)/eeprog.o $(EEPROMER_DIR)/24cXX.o
$(CC) $(LDFLAGS) -o $@ $^
#
# Objects
#
$(EEPROMER_DIR)/eepromer.o: $(EEPROMER_DIR)/eepromer.c
$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
$(EEPROMER_DIR)/eeprom.o: $(EEPROMER_DIR)/eeprom.c
$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
$(EEPROMER_DIR)/eeprog.o: $(EEPROMER_DIR)/eeprog.c
$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
$(EEPROMER_DIR)/24cXX.o: $(EEPROMER_DIR)/24cXX.c
$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
#
# Commands
#
all-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
strip-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
strip $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
clean-eepromer:
$(RM) $(addprefix $(EEPROMER_DIR)/,*.o $(EEPROMER_TARGETS))
install-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
$(INSTALL_DIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
for program in $(EEPROMER_TARGETS) ; do \
$(INSTALL_PROGRAM) $(EEPROMER_DIR)/$$program $(DESTDIR)$(sbindir) ; done
uninstall-eepromer:
for program in $(EEPROMER_TARGETS) ; do \
$(RM) $(DESTDIR)$(sbindir)/$$program ; \
$(RM) $(DESTDIR)$(man8dir)/$$program.8 ; done
all: all-eepromer
strip: strip-eepromer
clean: clean-eepromer
install: install-eepromer
uninstall: uninstall-eepromer
|