-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
131 lines (102 loc) · 2.5 KB
/
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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
ifeq (,$(wildcard config.mak))
$(error "config.mak is not present, run configure !")
endif
include config.mak
PKGCONFIG_DIR = $(libdir)/pkgconfig
PKGCONFIG_FILE = libfosfat.pc \
libfosgra.pc \
DISTFILE = fosfat-$(VERSION).tar.bz2
EXTRADIST = \
ChangeLog \
configure \
COPYING \
README \
TODO \
SUBDIRS = \
DOCS \
fosmount \
libfosfat \
libfosgra \
libw32disk \
tools \
all: libs fosmount tools docs
config.mak: configure
@echo "############################################################"
@echo "####### Please run ./configure again - it's changed! #######"
@echo "############################################################"
libs:
ifeq ($(BUILD_MINGW32),yes)
$(MAKE) -C libw32disk
endif
$(MAKE) -C libfosfat
$(MAKE) -C libfosgra
fosmount: libs
ifeq ($(FOSMOUNT),yes)
$(MAKE) -C fosmount
endif
tools: libs
ifeq ($(TOOLS),yes)
$(MAKE) -C tools
endif
docs:
$(MAKE) -C DOCS
docs-clean:
$(MAKE) -C DOCS clean
clean:
$(MAKE) -C fosmount clean
$(MAKE) -C libfosfat clean
$(MAKE) -C libfosgra clean
$(MAKE) -C libw32disk clean
$(MAKE) -C tools clean
distclean: clean docs-clean
rm -f config.log
rm -f config.mak
rm -f $(DISTFILE)
rm -f $(PKGCONFIG_FILE)
install: install-libs install-pkgconfig install-fosmount install-tools install-docs
install-libs:
ifeq ($(BUILD_MINGW32),yes)
$(MAKE) -C libw32disk install
endif
$(MAKE) -C libfosfat install
$(MAKE) -C libfosgra install
install-pkgconfig: $(PKGCONFIG_FILE)
for m in $(PKGCONFIG_FILE); do \
$(INSTALL) -d "$(PKGCONFIG_DIR)"; \
$(INSTALL) -m 644 $$m "$(PKGCONFIG_DIR)"; \
done
install-fosmount: fosmount
ifeq ($(FOSMOUNT),yes)
$(MAKE) -C fosmount install
endif
install-tools: tools
$(MAKE) -C tools install
install-docs: docs
$(MAKE) -C DOCS install
uninstall: uninstall-libs uninstall-pkgconfig uninstall-fosmount uninstall-tools uninstall-docs
uninstall-libs:
$(MAKE) -C libfosfat uninstall
$(MAKE) -C libfosgra uninstall
uninstall-pkgconfig:
for m in $(PKGCONFIG_FILE); do \
rm -f $(PKGCONFIG_DIR)/$$m; \
done
uninstall-fosmount:
$(MAKE) -C fosmount uninstall
uninstall-tools:
$(MAKE) -C tools uninstall
uninstall-docs:
$(MAKE) -C DOCS uninstall
.PHONY: *clean *install* docs fosmount tools
dist:
-$(RM) $(DISTFILE)
dist=$(shell pwd)/fosfat-$(VERSION) && \
for subdir in . $(SUBDIRS); do \
mkdir -p "$$dist/$$subdir"; \
$(MAKE) -C $$subdir dist-all DIST="$$dist/$$subdir"; \
done && \
tar cjf $(DISTFILE) fosfat-$(VERSION)
-$(RM) -rf fosfat-$(VERSION)
dist-all:
cp $(EXTRADIST) Makefile $(DIST)
.PHONY: dist dist-all