Added TOOLS_PATH macro and default target similar to that in reactos/rules.mak
[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 # Windows is default host environment
12 ifeq ($(HOST),)
13 HOST = mingw32-windows
14 endif
15
16
17 ifeq ($(HOST),mingw32-linux)
18 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
19 endif
20
21 #
22 # Choose various options
23 #
24 ifeq ($(HOST),mingw32-linux)
25 PREFIX = i586-mingw32-
26 EXE_POSTFIX =
27 CP = cp
28 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
29 FLOPPY_DIR = A/
30 # DIST_DIR should be relative from the top of the tree
31 DIST_DIR = dist
32 endif
33
34
35 ifeq ($(HOST),mingw32-windows)
36 PREFIX =
37 EXE_POSTFIX = .exe
38 CP = copy
39 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
40 RM = del
41 DOSCLI = yes
42 FLOPPY_DIR = A:
43 # DIST_DIR should be relative from the top of the tree
44 DIST_DIR = dist
45 endif
46
47 #
48 # Create variables for all the compiler tools
49 #
50 ifeq ($(WITH_DEBUGGING),yes)
51 DEBUGGING_CFLAGS = -g
52 else
53 DEBUGGING_CFLAGS =
54 endif
55
56 ifeq ($(WARNINGS_ARE_ERRORS),yes)
57 EXTRA_CFLAGS = -Werror
58 endif
59
60 DEFINES = -DDBG
61
62 ifeq ($(WIN32_LEAN_AND_MEAN),yes)
63 LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
64 else
65 LEAN_AND_MEAN_DEFINE =
66 endif
67
68 CC = $(PREFIX)gcc
69 NATIVE_CC = gcc
70 CFLAGS = \
71 $(BASE_CFLAGS) \
72 -pipe \
73 -O2 \
74 -Wall \
75 -Wstrict-prototypes \
76 -fno-builtin \
77 $(LEAN_AND_MEAN_DEFINE) \
78 $(DEFINES) \
79 $(DEBUGGING_CFLAGS) \
80 $(EXTRA_CFLAGS)
81 CXXFLAGS = $(CFLAGS)
82 LD = $(PREFIX)ld
83 NM = $(PREFIX)nm
84 OBJCOPY = $(PREFIX)objcopy
85 STRIP = $(PREFIX)strip
86 AS = $(PREFIX)gcc -c -x assembler-with-cpp
87 CPP = $(PREFIX)cpp
88 AR = $(PREFIX)ar
89 RC = $(PREFIX)windres
90 RCINC = --include-dir ../reactos/include --include-dir ../../reactos/include --include-dir ../../../reactos/include
91
92 TOOLS_PATH = $(PATH_TO_TOP)/../reactos/tools
93 RSYM = $(TOOLS_PATH)/rsym
94
95 %.o: %.cpp
96 $(CC) $(CFLAGS) -c $< -o $@
97 %.o: %.cc
98 $(CC) $(CFLAGS) -c $< -o $@
99 %.o: %.c
100 $(CC) $(CFLAGS) -c $< -o $@
101 %.o: %.asm
102 $(NASM_CMD) $(NFLAGS) $< -o $@
103 %.coff: %.rc
104 $(RC) $(RCFLAGS) $(RCINC) $< $@
105
106
107
108 RULES_MAK_INCLUDED = 1