02fdd62807cdaa2954bff2be28addf32391a7b30
[reactos.git] / reactos / tools / wmc / wmc.mak
1 WMC_BASE = $(TOOLS_BASE_)wmc
2 WMC_BASE_ = $(WMC_BASE)$(SEP)
3 WMC_INT = $(INTERMEDIATE_)$(WMC_BASE)
4 WMC_INT_ = $(WMC_INT)$(SEP)
5 WMC_OUT = $(OUTPUT_)$(WMC_BASE)
6 WMC_OUT_ = $(WMC_OUT)$(SEP)
7
8 $(WMC_INT): | $(TOOLS_INT)
9 $(ECHO_MKDIR)
10 ${mkdir} $@
11
12 ifneq ($(INTERMEDIATE),$(OUTPUT))
13 $(WMC_OUT): | $(TOOLS_OUT)
14 $(ECHO_MKDIR)
15 ${mkdir} $@
16 endif
17
18 WMC_TARGET = \
19 $(EXEPREFIX)$(WMC_OUT_)wmc$(EXEPOSTFIX)
20
21 WMC_SOURCES = $(addprefix $(WMC_BASE_), \
22 lang.c \
23 mcl.c \
24 utils.c \
25 wmc.c \
26 write.c \
27 mcy.tab.c \
28 )
29
30 WMC_OBJECTS = \
31 $(addprefix $(INTERMEDIATE_), $(WMC_SOURCES:.c=.o))
32
33 WMC_HOST_CFLAGS = -I$(WMC_BASE) $(TOOLS_CFLAGS) \
34 -D__USE_W32API -DWINE_UNICODE_API= -I$(UNICODE_BASE) \
35 -DDWORD="unsigned int" -DDWORD_DEFINED \
36 -DLONG="int" -DULONG="unsigned int" \
37 -DPULONG="unsigned int *" -DLONG_DEFINED \
38 -Dwchar_t="unsigned short" -D_WCHAR_T_DEFINED \
39 -Iinclude/reactos/wine -Iinclude/reactos -Iinclude
40
41 WMC_HOST_LFLAGS = $(TOOLS_LFLAGS)
42
43 WMC_LIBS = $(UNICODE_TARGET)
44
45 .PHONY: wmc
46 wmc: $(WMC_TARGET)
47
48 $(WMC_TARGET): $(WMC_OBJECTS) $(WMC_LIBS) | $(WMC_OUT)
49 $(ECHO_LD)
50 ${host_gcc} $(WMC_OBJECTS) $(WMC_LIBS) $(WMC_HOST_LFLAGS) -o $@
51
52 $(WMC_INT_)lang.o: $(WMC_BASE_)lang.c | $(WMC_INT)
53 $(ECHO_CC)
54 ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@
55
56 $(WMC_INT_)mcl.o: $(WMC_BASE_)mcl.c | $(WMC_INT)
57 $(ECHO_CC)
58 ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@
59
60 $(WMC_INT_)utils.o: $(WMC_BASE_)utils.c | $(WMC_INT)
61 $(ECHO_CC)
62 ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@
63
64 $(WMC_INT_)wmc.o: $(WMC_BASE_)wmc.c | $(WMC_INT)
65 $(ECHO_CC)
66 ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@
67
68 $(WMC_INT_)write.o: $(WMC_BASE_)write.c | $(WMC_INT)
69 $(ECHO_CC)
70 ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@
71
72 $(WMC_INT_)mcy.tab.o: $(WMC_BASE_)mcy.tab.c | $(WMC_INT)
73 $(ECHO_CC)
74 ${host_gcc} $(WMC_HOST_CFLAGS) -c $< -o $@
75
76 .PHONY: wmc_clean
77 wmc_clean:
78 -@$(rm) $(WMC_TARGET) $(WMC_OBJECTS) 2>$(NUL)
79 clean: wmc_clean