root/morphix/trunk/cloop/Makefile

Revision 2, 1.8 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

Line 
1 #!/usr/bin/make
2
3 KERNEL_DIR=/usr/src/linux
4
5 ifdef APPSONLY
6 CFLAGS:=-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -s -I. -fno-strict-aliasing -fno-common -fomit-frame-pointer
7 else
8 include $(KERNEL_DIR)/.config
9 #include $(KERNEL_DIR)/conf.vars
10 endif
11
12 CKERNOPS:=-D__KERNEL__ -DMODULE -fno-builtin -nostdlib -DKBUILD_MODNAME="cloop" -DKBUILD_BASENAME="cloop"
13
14 ifdef CONFIG_MODVERSIONS
15 MODVERSIONS:= -DMODVERSIONS -include $(KERNEL_DIR)/include/linux/modversions.h
16 CKERNOPS += $(MODVERSIONS)
17 endif
18
19 # Check for SMP in config and #define __SMP__ if necessary.
20 # This is ESSENTIAL when compiling a SMP version of cloop.o
21 # Otherwise, the module will block the entire block buffer management on read.
22
23 ifdef CONFIG_SMP
24 CKERNOPS += -D__SMP__
25 endif
26
27 KERNOBJ:=compressed_loop.o
28
29 # Name of module
30 #ifeq ($(PATCHLEVEL),6)
31 MODULE:=cloop.ko
32 #else
33 #;2BMODULE:=cloop.o
34 #endif
35
36 ALL_TARGETS = create_compressed_fs extract_compressed_fs
37 ifndef APPSONLY
38 ALL_TARGETS += $(MODULE)
39 endif
40
41 all: $(ALL_TARGETS)
42
43 $(MODULE): compressed_loop.o
44         @echo "Building for Kernel Patchlevel $(PATCHLEVEL)"
45         $(LD) -r -o $@ $^
46 #Old:   $(CC) -o $@ $< -lz
47
48 create_compressed_fs: advancecomp-1.9_create_compressed_fs/advfs
49         ln -f $< $@
50
51 advancecomp-1.9_create_compressed_fs/advfs:
52         ( $(MAKE) -C advancecomp-1.9_create_compressed_fs advfs )
53
54
55 extract_compressed_fs: extract_compressed_fs.o
56         $(CC) -o $@ $< -lz
57
58 clean:
59         rm -f $(KERNOBJ) create_compressed_fs extract_compressed_fs zoom *.o *.ko
60         $(MAKE) -C advancecomp-1.9_create_compressed_fs clean
61
62 dist: clean
63         cd .. ; \
64         tar -cf - cloop/{Makefile,*.[ch],CHANGELOG,README} | \
65         bzip2 -9 > $(HOME)/redhat/SOURCES/cloop.tar.bz2
66
67 # There must be a better way to handle this
68 $(KERNOBJ): %.o : %.c
69         $(CC) -I$(KERNEL_DIR)/include -I$(KERNEL_DIR)/include/asm/mach-default $(CFLAGS) $(CKERNOPS) $< -c -o $@
70
71 compressed_loop.o create_compressed_fs.o: compressed_loop.h
Note: See TracBrowser for help on using the browser.