Sync to Wine-20050524:
[reactos.git] / rosapps / rules.mak
1 #
2 # Important
3 #
4 .EXPORT_ALL_VARIABLES:
5
6 #
7 # Select your host
8 #HOST = mingw32-windows
9 #HOST = mingw32-linux
10 #
11
12 # Windows is default host environment
13 ifeq ($(HOST),)
14 HOST = mingw32-windows
15 endif
16
17
18 ifeq ($(HOST),mingw32-linux)
19 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
20 endif
21
22 W32API_PATH = $(PATH_TO_TOP)/../reactos/w32api
23
24 #
25 # Choose various options
26 #
27 ifeq ($(HOST),mingw32-linux)
28 PREFIX = mingw32-
29 EXE_POSTFIX =
30 CP = cp
31 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
32 RM = rm
33 DOSCLI = no
34 FLOPPY_DIR = /mnt/floppy
35 # DIST_DIR should be relative from the top of the tree
36 DIST_DIR = dist
37 SEP = /
38 endif
39
40
41 ifeq ($(HOST),mingw32-windows)
42 PREFIX =
43 EXE_POSTFIX = .exe
44 CP = copy
45 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
46 RM = del
47 DOSCLI = yes
48 FLOPPY_DIR = A:
49 # DIST_DIR should be relative from the top of the tree
50 DIST_DIR = dist
51 SEP = \$($EMPTY_VAR)
52 endif
53
54 # Set INSTALL_DIR to default value if not already set
55 # ifeq ($(INSTALL_DIR),)
56 INSTALL_DIR = $(PATH_TO_TOP)/reactos
57 # endif
58
59 #
60 # Create variables for all the compiler tools
61 #
62 ifeq ($(WITH_DEBUGGING),yes)
63 DEBUGGING_CFLAGS = -g
64 else
65 DEBUGGING_CFLAGS =
66 endif
67
68 ifeq ($(WARNINGS_ARE_ERRORS),yes)
69 EXTRA_CFLAGS = -Werror
70 endif
71
72 DEFINES = -DDBG
73
74 ifeq ($(WIN32_LEAN_AND_MEAN),yes)
75 LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
76 else
77 LEAN_AND_MEAN_DEFINE =
78 endif
79
80 CXX = $(PREFIX)g++
81 CC = $(PREFIX)gcc
82 NATIVE_CC = gcc
83 CFLAGS = \
84 $(BASE_CFLAGS) \
85 -pipe \
86 -O2 \
87 -Wall \
88 -Wstrict-prototypes \
89 -fno-builtin \
90 -I$(W32API_PATH)/include \
91 $(LEAN_AND_MEAN_DEFINE) \
92 $(DEFINES) \
93 $(DEBUGGING_CFLAGS) \
94 $(EXTRA_CFLAGS)
95 CXXFLAGS = $(CFLAGS)
96 LD = $(PREFIX)ld
97 NM = $(PREFIX)nm
98 OBJCOPY = $(PREFIX)objcopy
99 STRIP = $(PREFIX)strip
100 AS = $(PREFIX)gcc -c -x assembler-with-cpp
101 AR = $(PREFIX)ar
102 RC = $(PREFIX)windres
103 RCINC = --include-dir $(PATH_TO_TOP)/../reactos/include
104 TOOLS_PATH = $(PATH_TO_TOP)/../reactos/tools
105 RSYM = $(TOOLS_PATH)/rsym
106
107 %.o: %.cpp
108 $(CXX) $(CFLAGS) -c $< -o $@
109 %.o: %.cc
110 $(CXX) $(CFLAGS) -c $< -o $@
111 %.o: %.c
112 $(CC) $(CFLAGS) -c $< -o $@
113 %.o: %.asm
114 $(NASM_CMD) $(NFLAGS) $< -o $@
115 %.coff: %.rc
116 $(RC) $(RCFLAGS) $(RCINC) $< $@
117
118
119
120 RULES_MAK_INCLUDED = 1