summaryrefslogtreecommitdiff
path: root/unionfs/unionfs-1.0.3/make.patch
blob: dc3faf981a1c78ee247b101c064fec72fdb51d27 (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
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

#
# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
#

--- unionfs-1.0.3/Makefile~make.patch	2004-11-10 09:38:58.000000000 -0500
+++ unionfs-1.0.3/Makefile	2004-11-14 02:41:12.812518968 -0500
@@ -3,20 +3,32 @@
 #
 
 # this should point to where your kernel headers are
-TOPINC	= -I/lib/modules/`uname -r`/build/include
+KERNELVER = $(shell uname -r)
+KERNELINC = -I/lib/modules/$(KERNELVER)/build/include
+
 # This is where the make install target will put stuff
-PREFIX  = /usr/local
+DESTDIR	=
+prefix	= /usr/local
+sbindir	= $(prefix)/sbin
+mandir	= $(prefix)/man
+man4dir	= $(mandir)/man4
+man8dir = $(mandir)/man8
+moduledir = /lib/modules/$(KERNELVER)
+
 VERSION = 1.0.3
 
-# allow custmom override of TOPINC for fistgen developers
+# allow custmom override of KERNELINC for fistgen developers
 -include fistdev.mk
 
-CC	= gcc
-CFLAGS = -D__KERNEL__ -DMODULE -DFISTGEN -I. ${TOPINC} -Wall -Wno-unused-label -Werror -g ${EXTRACFLAGS} -O2
-UCFLAGS = -DFISTGEN -I. ${TOPINC} -g -O2 -Wall -Wno-unused -Werror ${EXTRAUCFLAGS}
+CC	 = gcc
+LD	 = ld
+R_CFLAGS = -D__KERNEL__ -DMODULE -DFISTGEN -I.
+CFLAGS	 = $(KERNELINC) -Wall -Wno-unused-label -Werror -g $(EXTRACFLAGS) -O2
+R_UCFLAGS = -DFISTGEN -I.
+UCFLAGS	  = $(KERNELINC) -g -O2 -Wall -Wno-unused -Werror $(EXTRAUCFLAGS)
 
 O_TARGET := unionfs.o
-ADD_M_SRC =  
+ADD_M_SRC =
 # vm_area.o is not needed if we use generic_file_mmap
 # mmap.o and attach.o are optionally added
 O_OBJS   := subr.o dentry.o file.o inode.o main.o super.o print.o \
@@ -27,16 +39,19 @@
 
 BINS	:=	unionctl uniondbg
 
-all:	${O_TARGET} ${BINS}
+all:	$(O_TARGET) $(BINS)
 
-${O_TARGET}: ${O_OBJS}
-	ld -o ${O_TARGET} -r ${O_OBJS}
+$(O_TARGET): $(O_OBJS)
+	$(LD) -o $(O_TARGET) -r $(O_OBJS)
+
+%.o: %.c
+	$(CC) -c -o $@ $< $(R_CFLAGS) $(CFLAGS)
 
 unionctl: unionctl.c
-	${CC} -o $@ $? ${UCFLAGS}
+	$(CC) -o $@ $? $(R_UCFLAGS) $(UCFLAGS)
 
 uniondbg: uniondbg.c
-	${CC} -o $@ $? ${UCFLAGS}
+	$(CC) -o $@ $? $(R_UCFLAGS) $(UCFLAGS)
 
 memtest:
 	perl match-malloc.pl log.txt
@@ -48,29 +63,30 @@
 	ctags *.[ch]
 
 clean:
-	rm -f ${O_TARGET} ${O_OBJS} *.d .*.flags \#* *~
-	rm -f ${BINS} TAGS tags
-	rm -f unionfs-${VERSION}.tar.gz
+	rm -f $(O_TARGET) $(O_OBJS) *.d .*.flags \#* *~
+	rm -f $(BINS) TAGS tags
+	rm -f unionfs-$(VERSION).tar.gz
 
-${O_OBJS}: unionfs.h fist.h
+$(O_OBJS): unionfs.h fist.h
 
 install: all
-	mkdir -p ${PREFIX}/sbin
-	cp unionctl ${PREFIX}/sbin
-	cp uniondbg ${PREFIX}/sbin
-	mkdir -p ${PREFIX}/man/man4
-	mkdir -p ${PREFIX}/man/man8
-	cp man/unionfs.4 ${PREFIX}/man/man4
-	cp man/unionctl.8 ${PREFIX}/man/man8
-	cp man/uniondbg.8 ${PREFIX}/man/man8
-	cp unionfs.o /lib/modules/`uname -r`/kernel/fs
+	mkdir -p $(DESTDIR)$(sbindir)
+	cp unionctl $(DESTDIR)$(sbindir)
+	cp uniondbg $(DESTDIR)$(sbindir)
+	mkdir -p $(DESTDIR)$(man4dir)
+	mkdir -p $(DESTDIR)$(man8dir)
+	cp man/unionfs.4 $(DESTDIR)$(man4dir)
+	cp man/unionctl.8 $(DESTDIR)$(man8dir)
+	cp man/uniondbg.8 $(DESTDIR)$(man8dir)
+	mkdir -p $(DESTDIR)$(moduledir)/kernel/fs
+	cp unionfs.o $(DESTDIR)$(moduledir)/kernel/fs
 
-release: unionfs-${VERSION}.tar.gz
+release: unionfs-$(VERSION).tar.gz
 
-unionfs-${VERSION}.tar.gz:
-	mkdir unionfs-${VERSION}
-	cp COPYING README NEWS doit.sh undoit.sh *.pl Makefile *.[ch] misc/snapmerge unionfs-${VERSION}
-	mkdir unionfs-${VERSION}/man
-	cp man/*.[0-9] unionfs-${VERSION}/man
-	tar czvf unionfs-${VERSION}.tar.gz unionfs-${VERSION}
-	rm -rf unionfs-${VERSION}
+unionfs-$(VERSION).tar.gz:
+	mkdir unionfs-$(VERSION)
+	cp COPYING README NEWS doit.sh undoit.sh *.pl Makefile *.[ch] misc/snapmerge unionfs-$(VERSION)
+	mkdir unionfs-$(VERSION)/man
+	cp man/*.[0-9] unionfs-$(VERSION)/man
+	tar czvf unionfs-$(VERSION).tar.gz unionfs-$(VERSION)
+	rm -rf unionfs-$(VERSION)