DiskTool - Side project to use the VFS for image manipulation
[tpg/acess2.git] / Tools / DiskTool / src / Makefile
1
2 TARGET := $(shell gcc -v 2>&1 | grep Targ | awk '{print $$2}')
3
4 KERNEL_SRC = ../../../KernelLand/Kernel/
5
6 BIN = ../DiskTool
7 # Kernel Sources (compiled with -ffreestanding)
8 K_OBJ  = vfs/main.o vfs/open.o vfs/acls.o vfs/io.o vfs/dir.o
9 K_OBJ += vfs/nodecache.o vfs/mount.o vfs/memfile.o vfs/select.o
10 K_OBJ += vfs/fs/root.o vfs/fs/devfs.o
11 K_OBJ += drv/proc.o
12 # Local kernel soruces (same as above, but located in same directory as Makefile)
13 L_OBJ = vfs_handles.o threads.o nativefs.o
14 # Native Sources (compiled as usual)
15 N_OBJ = main.o script.o logging.o
16
17 # Compilation Options
18 CFLAGS := -Wall
19 CPPFLAGS := -I include/
20 K_CPPFLAGS := -I $(KERNEL_SRC)include
21
22 # == Start of Magic ==
23 OBJ_PREFIX = obj/$(TARGET)/
24 K_OBJ_PREFIX = $(OBJ_PREFIX)_Kernel/
25 K_OBJ := $(addprefix $(K_OBJ_PREFIX),$(K_OBJ))
26 L_OBJ := $(addprefix $(OBJ_PREFIX),$(L_OBJ))
27 N_OBJ := $(addprefix $(OBJ_PREFIX),$(N_OBJ))
28
29 OBJ := $(N_OBJ) $(L_OBJ) $(K_OBJ)
30
31 DEPFILES  = $(filter %.o,$(OBJ))
32 DEPFILES := $(DEPFILES:%=%.dep)
33
34
35 .PHONY: all clean
36
37 all: $(BIN)
38
39 clean:
40         $(RM) -f $(OBJ) $(DEPFILES) $(BIN)
41
42 $(BIN): $(OBJ)
43         $(CC) -o $(BIN) $(OBJ) $(LDFLAGS)
44
45 $(K_OBJ): $(K_OBJ_PREFIX)%.o: $(KERNEL_SRC)%.c
46         @mkdir -p $(dir $@)
47         $(CC) -c $< -o $@ -ffreestanding $(CFLAGS) $(CPPFLAGS) $(K_CPPFLAGS) -MMD -MP -MF [email protected]
48
49 $(L_OBJ): $(OBJ_PREFIX)%.o: %.c
50         @mkdir -p $(dir $@)
51         $(CC) -c $< -o $@ -ffreestanding $(CFLAGS) $(CPPFLAGS) $(K_CPPFLAGS) -MMD -MP -MF [email protected]
52
53 $(N_OBJ): $(OBJ_PREFIX)%.o: %.c
54         @mkdir -p $(dir $@)
55         $(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS) -MMD -MP -MF [email protected]
56
57 -include $(DEPFILES)

UCC git Repository :: git.ucc.asn.au