|
|
1.1 root 1: # If you want or need to change something herein, please look approx. 30 lines
2: # below for the 'User Config Section'
3:
4: ########################################################################
5: # The next lines are hacks for automatic detection of different kernel setups.
6: # These things must happen first, please don't change them here. They can be
7: # overridden later.
8: #
9: # we try to guess some settings from kernel configuration :)
10: -include /usr/src/linux/.config
11: #
12: # guess some special flags for CPU type - used for optimization only
13: CPUFLAGS=
14: ifeq ($(CONFIG_M386),y)
15: CPUFLAGS= -m386 -DCPU=386 -DUSE_ASM
16: endif
17: ifeq ($(CONFIG_M486),y)
18: CPUFLAGS= -m486 -DCPU=486 -DUSE_ASM
19: endif
20: ifeq ($(CONFIG_M586),y)
21: CPUFLAGS= -m486 -DCPU=586 -DUSE_ASM
22: endif
1.1.1.2 ! root 23: # this one is new in 2.2.x kernels...
! 24: ifeq ($(CONFIG_M586TSC),y)
! 25: CPUFLAGS= -m486 -DCPU=586 -DUSE_ASM
! 26: endif
1.1 root 27: ifeq ($(CONFIG_M686),y)
28: CPUFLAGS= -m486 -DCPU=686 -DUSE_ASM
29: endif
1.1.1.2 ! root 30: # this one is new in 2.3.x kernels...
! 31: ifeq ($(CONFIG_MK7),y)
! 32: CPUFLAGS= -m486 -DCPU=686 -DUSE_ASM
! 33: endif
1.1 root 34: #
35: # Okay, that's it :)
36: ########################################################################
37:
38: ########################################################################
39: # *** User Config Section ***
40: # Here you can look for settings to change if the code refuses to compile
41: # out of the box. There are so many different systems. So many versions
42: # of compilers. So many different bugs. :(
43: #
44: # Select compiler
45: CC=gcc
46: #
47: # If cpu specific optimization fails, uncomment the next line to switch it
48: # off - there are some gas versions around that don't like the cpu specific
49: # asm instructions in dmsdos...
50: # CPUFLAGS=
51: #
52: # Some gnu assembler versions have a bug in the syntax for the xlat
53: # instruction. This enables a workaround. It should only be needed for very
54: # old binutils versions. I don't know for which ones :(
55: # CPUFLAGS+= -DGAS_XLAT_BUG
56: #
57: # The next lines should detect SMP configuration automatically.
58: # Comment them out or set it manually if it fails.
59: ifeq ($(SMP),1)
60: CPUFLAGS+= -D__SMP__
61: endif
1.1.1.2 ! root 62: # 2.2.x kernels have this one...
! 63: ifeq ($(CONFIG_SMP),y)
! 64: CPUFLAGS+= -D__SMP__
! 65: endif
1.1 root 66: #
67: # The next lines are for libc6 and enable some compatibility hacks -
68: # uncomment the line with -D__FOR_LIBC6 if the code does not compile
69: # *** Currently not used - code should compile under libc6 without hacks
70: LIBC6FLAGS=
71: #LIBC6FLAGS= -D__FOR_LIBC6
72: #
73: # CFLAGS for dmsdos module
74: # note: some macro expansions require at least -O
75: CFLAGS= -Wall -Wstrict-prototypes -O3 -fomit-frame-pointer -D__KERNEL__ -DMODULE
76: CFLAGS+= $(CPUFLAGS)
77: #
78: # The next lines add some stuff automatically for people using modversions
79: # if they fail, comment them out and set the required flags manually
80: ifeq ($(CONFIG_MODVERSIONS),y)
81: CFLAGS+= -DMODVERSIONS -include /usr/include/linux/modversions.h
82: endif
83: #
84: # CFLAGS for the dmsdos daemon
85: # note: some macro expansions require at least -O
86: DCFLAGS= -Wall -O3 -D__DMSDOS_DAEMON__
87: DCFLAGS+= $(CPUFLAGS)
88: #
89: # CFLAGS for the dmsdos library
90: # note: some macro expansions require at least -O
1.1.1.2 ! root 91: LCFLAGS= -Wall -O -ggdb -D__DMSDOS_LIB__ -DUSE_FLOCK
1.1 root 92: LCFLAGS+= $(CPUFLAGS) $(LIBC6FLAGS)
1.1.1.2 ! root 93: # uncomment the next line if you want a shared library
! 94: # LIB_SHARED = 1
1.1 root 95: #
96: # locations where to install the module, the executables and the manpages
97: # note: `uname -r` expands to the *currently running* kernel version - if it
98: # is different from that in /usr/src/linux you'd better edit the next line :)
99: MODULE_PREFIX=/lib/modules/`uname -r`/fs
100: #MODULE_PREFIX=/lib/modules/misc
101: EXEC_PREFIX=/usr/local/bin
102: #
103: # Okay, that's the end of the User Config Section.
104: ##########################################################################
105:
106: ##########################################################################
107: # The rest of this file are rules how to build which programs.
108:
1.1.1.2 ! root 109: all: dmsdos-config.h dmsdos.o dutil dmsdosd $(LIBDMSDOS) dcread dmsdosfsck \
! 110: mcdmsdos cvflist cvftest
1.1 root 111:
112: min: dmsdos-config.h dmsdos.o dutil
113:
114: dmsdos-config.h:
115: /bin/bash conf-wrapper.sh
116: make dep
117:
118: config:
119: /bin/bash Configure
120: make dep
121:
122: menuconfig:
123: /bin/bash Menuconfig
124: make dep
125:
126: dep:
127: ./check.sh
128: $(CC) -w -E -MM -D__KERNEL__ -D__MODULE__ -DMODULE dblspace*.c dstacker*.c > depend
129:
130: depend:
131: @touch depend
132:
133: DBL_OBJS = dblspace_compr.o dblspace_tables.o \
1.1.1.2 ! root 134: dblspace_alloc.o dblspace_dec.o dblspace_virtual.o \
! 135: dblspace_buffer.o dblspace_methsq.o \
! 136: dblspace_chk.o dblspace_interface.o \
! 137: dstacker_alloc.o dstacker_compr.o dstacker_dec.o \
! 138: dblspace_fileops.o dblspace_ioctl.o
1.1 root 139:
140: $(DBL_OBJS): dmsdos.h dmsdos-config.h
141:
1.1.1.2 ! root 142: dblspace_fileops.o : dblspace_fileops.c dblspace_fileops.c-2.0.33 \
! 143: dblspace_fileops.c-2.1.80 dblspace_fileops.c-2.3.10
! 144:
1.1 root 145: dmsdos.o: $(DBL_OBJS)
146: ld -r -o dmsdos.o $(DBL_OBJS)
147:
148: dutil: dutil.c dmsdos.h dmsdos-config.h
149: $(CC) $(DCFLAGS) -o dutil dutil.c
150:
151: DAEMON_OBJS = daemon_actions.do dblspace_compr.do dstacker_compr.do \
1.1.1.2 ! root 152: dblspace_methsq.do
1.1 root 153:
154: $(DAEMON_OBJS): dmsdos.h dmsdos-config.h
155:
156: %.do: %.c ; $(CC) -o $@ $(DCFLAGS) -c $<
157:
158: dmsdosd: $(DAEMON_OBJS)
159: $(CC) -o dmsdosd $^
160:
161: clean:
1.1.1.2 ! root 162: rm -f *.o *.a *.i *.s *.lo *.do *.so *.so.* dutil dmsdosd dcread \
! 163: dmsdosfsck cvftest cvflist mcdmsdos
1.1 root 164:
165: mrproper: clean
166: rm -f core *~ depend
167: rm -f .config* dmsdos-config.h .menuconfig*
168:
169: install: all
170: ./check.sh
171: install dmsdos.o -m 644 $(MODULE_PREFIX)/dmsdos.o
172: install dutil $(EXEC_PREFIX)/dutil
173: install dmsdosd $(EXEC_PREFIX)/dmsdosd
174: install dmsdosfsck $(EXEC_PREFIX)/dmsdosfsck
1.1.1.2 ! root 175: install mcdmsdos $(EXEC_PREFIX)/mcdmsdos
! 176: install cvflist $(EXEC_PREFIX)/cvflist
! 177: install cvftest $(EXEC_PREFIX)/cvftest
1.1 root 178:
179: install-min: min
180: ./check.sh
181: install dmsdos.o $(MODULE_PREFIX)/dmsdos.o
182: install dutil $(EXEC_PREFIX)/dutil
183:
184: uninstall:
185: rm -f $(MODULE_PREFIX)/dmsdos.o
186: rm -f $(EXEC_PREFIX)/dutil
187: rm -f $(EXEC_PREFIX)/dmsdosd
188: rm -f $(EXEC_PREFIX)/dmsdosfsck
1.1.1.2 ! root 189: rm -f $(EXEC_PREFIX)/mcdmsdos
! 190: rm -f $(EXEC_PREFIX)/cvflist
! 191: rm -f $(EXEC_PREFIX)/cvftest
1.1 root 192:
193: messages:
194: grep DMSDOS ../doc/messages.doc | sort -d -b -f > /tmp/messdoc
195: ./listmsg.sh -LOG > /tmp/messsrc
196: diff -d -U 0 -w /tmp/messdoc /tmp/messsrc | grep DMSDOS
197:
198: LIB_OBJS = lib_interface.lo dblspace_interface.lo dblspace_dec.lo \
1.1.1.2 ! root 199: dblspace_compr.lo dblspace_methsq.lo dblspace_alloc.lo \
! 200: dblspace_chk.lo dblspace_tables.lo dstacker_compr.lo \
! 201: dstacker_dec.lo dstacker_alloc.lo
1.1 root 202:
203: $(LIB_OBJS): dmsdos.h dmsdos-config.h lib_interface.h
204:
1.1.1.2 ! root 205: ifndef LIB_SHARED
! 206:
! 207: LIBDMSDOS = libdmsdos.a
! 208:
1.1 root 209: %.lo: %.c ; $(CC) -o $@ $(LCFLAGS) -c $<
210:
1.1.1.2 ! root 211: $(LIBDMSDOS): $(LIB_OBJS)
! 212: ar rcs $(LIBDMSDOS) $^
! 213: ranlib $(LIBDMSDOS)
! 214:
! 215: else
! 216:
! 217: %.lo: %.c ; $(CC) --shared -o $@ $(LCFLAGS) -c $<
1.1 root 218:
1.1.1.2 ! root 219: LIBDMSDOS = libdmsdos.so.0.9.2
1.1 root 220:
1.1.1.2 ! root 221: $(LIBDMSDOS): $(LIB_OBJS)
! 222: ld --shared --soname=$(LIBDMSDOS) -o $(LIBDMSDOS) $^
! 223: ln -s $(LIBDMSDOS) libdmsdos.so
1.1 root 224:
1.1.1.2 ! root 225: endif
! 226:
! 227: dcread: dcread.c $(LIBDMSDOS) dmsdos.h dmsdos-config.h
1.1 root 228: $(CC) -Wall -ggdb -o dcread dcread.c -L. -ldmsdos
229:
1.1.1.2 ! root 230: mcdmsdos: mcdmsdos.c $(LIBDMSDOS) dmsdos.h dmsdos-config.h
! 231: $(CC) -Wall -ggdb -o mcdmsdos mcdmsdos.c -L. -ldmsdos
! 232:
! 233: dmsdosfsck: dmsdosfsck.c $(LIBDMSDOS) dmsdos.h dmsdos-config.h
1.1 root 234: $(CC) -Wall -o dmsdosfsck dmsdosfsck.c -L. -ldmsdos
235:
236: cvftest: cvftest.c
237: $(CC) -Wall -o cvftest cvftest.c
238:
1.1.1.2 ! root 239: cvflist: cvflist.c
! 240: $(CC) -Wall -o cvflist cvflist.c
! 241:
1.1 root 242: -include depend
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.