Cleanup code for easier porting to other architectures
[reactos.git] / reactos / tools / nci / nci.mak
1 NCI_BASE = $(TOOLS_BASE_)nci
2 NCI_BASE_ = $(NCI_BASE)$(SEP)
3 NCI_INT = $(INTERMEDIATE_)$(NCI_BASE)
4 NCI_INT_ = $(NCI_INT)$(SEP)
5 NCI_OUT = $(OUTPUT_)$(NCI_BASE)
6 NCI_OUT_ = $(NCI_OUT)$(SEP)
7
8 $(NCI_INT): | $(TOOLS_INT)
9 $(ECHO_MKDIR)
10 ${mkdir} $@
11
12 ifneq ($(INTERMEDIATE),$(OUTPUT))
13 $(NCI_OUT): | $(TOOLS_OUT)
14 $(ECHO_MKDIR)
15 ${mkdir} $@
16 endif
17
18 NCI_TARGET = \
19 $(EXEPREFIX)$(NCI_OUT_)nci$(EXEPOSTFIX)
20
21 NCI_SOURCES = \
22 $(NCI_BASE_)ncitool.c
23
24 NCI_OBJECTS = \
25 $(addprefix $(INTERMEDIATE_), $(NCI_SOURCES:.c=.o))
26
27 NCI_HOST_CFLAGS = -Iinclude $(TOOLS_CFLAGS)
28
29 NCI_HOST_LFLAGS = $(TOOLS_LFLAGS)
30
31 $(NCI_TARGET): $(NCI_OBJECTS) | $(NCI_OUT)
32 $(ECHO_LD)
33 ${host_gcc} $(NCI_OBJECTS) $(NCI_HOST_LFLAGS) -o $@
34
35 $(NCI_INT_)ncitool.o: $(NCI_BASE_)ncitool.c | $(NCI_INT)
36 $(ECHO_CC)
37 ${host_gcc} $(NCI_HOST_CFLAGS) -c $< -o $@
38
39 .PHONY: nci_clean
40 nci_clean:
41 -@$(rm) $(NCI_TARGET) $(NCI_OBJECTS) 2>$(NUL)
42 clean: nci_clean
43
44 # WIN32K.SYS
45 WIN32K_SVC_DB = $(NCI_BASE_)w32ksvc.db
46 WIN32K_SERVICE_TABLE = subsystems$(SEP)win32$(SEP)win32k$(SEP)include$(SEP)napi.h
47 WIN32K_GDI_STUBS = dll$(SEP)win32$(SEP)gdi32$(SEP)misc$(SEP)win32k.S
48 WIN32K_USER_STUBS = dll$(SEP)win32$(SEP)user32$(SEP)misc$(SEP)win32k.S
49
50 # NTOSKRNL.EXE
51 KERNEL_SVC_DB = $(NCI_BASE_)sysfuncs.lst
52 KERNEL_SERVICE_TABLE = ntoskrnl$(SEP)include$(SEP)internal$(SEP)napi.h
53 NTDLL_STUBS = dll$(SEP)ntdll$(SEP)napi.S
54 KERNEL_STUBS = ntoskrnl$(SEP)ex$(SEP)zw.S
55
56 NCI_SERVICE_FILES = \
57 $(KERNEL_SERVICE_TABLE) \
58 $(WIN32K_SERVICE_TABLE) \
59 $(NTDLL_STUBS) \
60 $(KERNEL_STUBS) \
61 $(WIN32K_GDI_STUBS) \
62 $(WIN32K_USER_STUBS)
63
64 $(NCI_SERVICE_FILES): $(NCI_TARGET) $(KERNEL_SVC_DB) $(WIN32K_SVC_DB)
65 $(ECHO_NCI)
66 $(Q)$(NCI_TARGET) \
67 $(KERNEL_SVC_DB) \
68 $(WIN32K_SVC_DB) \
69 $(KERNEL_SERVICE_TABLE) \
70 $(WIN32K_SERVICE_TABLE) \
71 $(NTDLL_STUBS) \
72 $(KERNEL_STUBS) \
73 $(WIN32K_GDI_STUBS) \
74 $(WIN32K_USER_STUBS)
75
76 .PHONY: nci_service_files_clean
77 nci_service_files_clean:
78 -@$(rm) $(NCI_SERVICE_FILES) 2>$(NUL)
79 clean: nci_service_files_clean