-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
36 lines (27 loc) · 909 Bytes
/
Makefile
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
include config.mk
SRC = main.c
OBJ = $(SRC:.c=.o)
CRYPTOOBJ = $(CRYPTO:.c=.o)
TOMOBJ = $(LIBTOM:.c=.o)
UPGRADEOBJ = $(UPGRADE:.c=.o)
all: options mktiupgrade
options:
@echo mktiupgrade build options:
@echo "CFLAGS = $(CFLAGS)"
@echo "CC = $(CC)"
$(CRYPTOOBJ) $(TOMOBJ) $(UPGRADEOBJ) $(OBJ):
$(CC) -c -o $@ $(CFLAGS) $(@:.o=.c)
mktiupgrade: $(CRYPTOOBJ) $(TOMOBJ) $(UPGRADEOBJ) $(OBJ)
$(CC) -o $@ $(CRYPTOOBJ) $(TOMOBJ) $(UPGRADEOBJ) $(OBJ)
scdoc < mktiupgrade.1.scdoc > mktiupgrade.1
clean:
rm -rf mktiupgrade mktiupgrade.1
rm -rf $(OBJ) $(CRYPTOOBJ) $(TOMOBJ) $(UPGRADEOBJ)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f mktiupgrade $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
cp -f mktiupgrade.1 $(DESTDIR)$(MANPREFIX)/man1
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/mktiupgrade $(DESTDIR)$(MANPREFIX)/man1/mktiupgrade.1
.PHONY: all options clean install uninstall