still serv_close bug...
[mit-jos.git] / fs / Makefrag
blobe13e363cffd9626547bf2e016c71ed16afcf1b1b
2 OBJDIRS += fs
4 FSOFILES :=             $(OBJDIR)/fs/ide.o \
5                         $(OBJDIR)/fs/fs.o \
6                         $(OBJDIR)/fs/serv.o \
7                         $(OBJDIR)/fs/test.o \
9 USERAPPS :=             $(OBJDIR)/user/cat \
10                         $(OBJDIR)/user/echo \
11                         $(OBJDIR)/user/init \
12                         $(OBJDIR)/user/ls \
13                         $(OBJDIR)/user/lsfd \
14                         $(OBJDIR)/user/num \
15                         $(OBJDIR)/user/forktree \
16                         $(OBJDIR)/user/primes
18 FSIMGTXTFILES :=        fs/newmotd \
19                         fs/motd
21 USERAPPS :=             $(USERAPPS) \
22                         $(OBJDIR)/user/primespipe \
23                         $(OBJDIR)/user/sh \
24                         $(OBJDIR)/user/testfdsharing \
25                         $(OBJDIR)/user/testkbd \
26                         $(OBJDIR)/user/testpipe \
27                         $(OBJDIR)/user/testpteshare \
28                         $(OBJDIR)/user/testshell \
29                         $(OBJDIR)/user/testmalloc
31 FSIMGTXTFILES :=        $(FSIMGTXTFILES) \
32                         fs/lorem \
33                         fs/script \
34                         fs/out \
35                         fs/testshell.key \
36                         fs/testshell.out \
37                         fs/testshell.sh
39 FSIMGFILES := $(FSIMGTXTFILES) $(USERAPPS)
41 $(OBJDIR)/fs/%.o: fs/%.c fs/fs.h inc/lib.h
42         @echo + cc[USER] $<
43         @mkdir -p $(@D)
44         $(V)$(CC) -nostdinc $(USER_CFLAGS) -c -o $@ $<
46 $(OBJDIR)/fs/fs: $(FSOFILES) $(OBJDIR)/lib/entry.o $(OBJDIR)/lib/libjos.a user/user.ld
47         @echo + ld $@
48         $(V)mkdir -p $(@D)
49         $(V)$(LD) -o $@ $(ULDFLAGS) $(LDFLAGS) -nostdlib \
50                 $(OBJDIR)/lib/entry.o $(FSOFILES) \
51                 -L$(OBJDIR)/lib -ljos $(GCC_LIB)
52         $(V)$(OBJDUMP) -S $@ >$@.asm
54 # How to build the file system image
55 $(OBJDIR)/fs/fsformat: fs/fsformat.c
56         @echo + mk $(OBJDIR)/fs/fsformat
57         $(V)mkdir -p $(@D)
58         $(V)gcc $(USER_CFLAGS) -o $(OBJDIR)/fs/fsformat fs/fsformat.c
60 $(OBJDIR)/fs/clean-fs.img: $(OBJDIR)/fs/fsformat $(FSIMGFILES)
61         @echo + mk $(OBJDIR)/fs/clean-fs.img
62         $(V)mkdir -p $(@D)
63         $(V)$(OBJDIR)/fs/fsformat $(OBJDIR)/fs/clean-fs.img 1024 $(FSIMGFILES)
65 $(OBJDIR)/fs/fs.img: $(OBJDIR)/fs/clean-fs.img
66         @echo + cp $(OBJDIR)/fs/clean-fs.img $@
67         $(V)cp $(OBJDIR)/fs/clean-fs.img $@
69 all: $(OBJDIR)/fs/fs.img
71 #all: $(addsuffix .sym, $(USERAPPS))
73 #all: $(addsuffix .asm, $(USERAPPS))