-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
101 lines (86 loc) · 3.17 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
MyProductName = "NFS-Win"
MyCompanyName = "Navimatics Corporation"
MyDescription = "NFS for Windows"
MyVersion = 1.0.$(shell date '+%y%j')
PrjDir = $(shell pwd)
BldDir = .build
DistDir = $(BldDir)/dist
SrcDir = $(BldDir)/src
RootDir = $(BldDir)/root
WixDir = $(BldDir)/wix
Status = $(BldDir)/status
BinExtra= #bash ls mount
export PATH := /cygdrive/c/Program Files (x86)/WiX Toolset v3.10/bin:$(PATH)
goal: $(Status) $(Status)/done
$(Status):
mkdir -p $(Status)
$(Status)/done: $(Status)/dist
touch $(Status)/done
$(Status)/dist: $(Status)/wix
mkdir -p $(DistDir)
cp $(shell cygpath -aw $(WixDir)/nfs-win-$(MyVersion).msi) $(DistDir)
touch $(Status)/dist
$(Status)/wix: $(Status)/nfs-win
mkdir -p $(WixDir)
cp nfs-win.wxs $(WixDir)/
candle -nologo -arch x86 -pedantic\
-dMyProductName=$(MyProductName)\
-dMyCompanyName=$(MyCompanyName)\
-dMyDescription=$(MyDescription)\
-dMyVersion=$(MyVersion)\
-o "$(shell cygpath -aw $(WixDir)/nfs-win.wixobj)"\
"$(shell cygpath -aw $(WixDir)/nfs-win.wxs)"
heat dir $(shell cygpath -aw $(RootDir))\
-nologo -dr INSTALLDIR -cg C.Main -srd -ke -sreg -gg -sfrag\
-o $(shell cygpath -aw $(WixDir)/root.wxs)
candle -nologo -arch x86 -pedantic\
-dMyProductName=$(MyProductName)\
-dMyCompanyName=$(MyCompanyName)\
-dMyDescription=$(MyDescription)\
-dMyVersion=$(MyVersion)\
-o "$(shell cygpath -aw $(WixDir)/root.wixobj)"\
"$(shell cygpath -aw $(WixDir)/root.wxs)"
light -nologo\
-o $(shell cygpath -aw $(WixDir)/nfs-win-$(MyVersion).msi)\
-ext WixUIExtension\
-b $(RootDir)\
$(shell cygpath -aw $(WixDir)/root.wixobj)\
$(shell cygpath -aw $(WixDir)/nfs-win.wixobj)
touch $(Status)/wix
$(Status)/nfs-win: $(Status)/root nfs-win.c
gcc -o $(RootDir)/bin/nfs-win nfs-win.c
strip $(RootDir)/bin/nfs-win
touch $(Status)/nfs-win
$(Status)/root: $(Status)/make
mkdir -p $(RootDir)/{bin,dev/{mqueue,shm},etc}
(cygcheck $(SrcDir)/fuse-nfs/fuse/.libs/fuse-nfs; for f in $(BinExtra); do cygcheck /usr/bin/$$f; done) |\
tr -d '\r' | tr '\\' / | xargs cygpath -au | grep '^/usr/bin/' | sort | uniq |\
while read f; do cp $$f $(RootDir)/bin; done
cp $(SrcDir)/fuse-nfs/fuse/.libs/fuse-nfs $(RootDir)/bin
strip $(RootDir)/bin/fuse-nfs
for f in $(BinExtra); do cp /usr/bin/$$f $(RootDir)/bin; done
cp $(PrjDir)/fstab $(RootDir)/etc
touch $(Status)/root
$(Status)/make: $(Status)/config
cd $(SrcDir)/libnfs && make
cd $(SrcDir)/fuse-nfs && make
touch $(Status)/make
$(Status)/config: $(Status)/reconf
cd $(SrcDir)/libnfs && ./configure
cd $(SrcDir)/fuse-nfs && ./configure CFLAGS="$(shell pkg-config fuse --cflags) -I$$PWD/../libnfs/include" LDFLAGS="-L$$PWD/../libnfs/lib"
touch $(Status)/config
$(Status)/reconf: $(Status)/patch
cd $(SrcDir)/libnfs && autoreconf -i
cd $(SrcDir)/fuse-nfs && autoreconf -i
touch $(Status)/reconf
$(Status)/patch: $(Status)/clone
cd $(SrcDir)/libnfs && for f in $(PrjDir)/patches/libnfs/*.patch; do patch -p1 <$$f; done
cd $(SrcDir)/fuse-nfs && for f in $(PrjDir)/patches/fuse-nfs/*.patch; do patch -p1 <$$f; done
touch $(Status)/patch
$(Status)/clone:
mkdir -p $(SrcDir)
git clone $(PrjDir)/libnfs $(SrcDir)/libnfs
git clone $(PrjDir)/fuse-nfs $(SrcDir)/fuse-nfs
touch $(Status)/clone
clean:
git clean -dffx