Mainly standardisation of makefiles, now support make install rules and use ros heade...
[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 #
23 # Choose various options
24 #
25 ifeq ($(HOST),mingw32-linux)
26 PREFIX = mingw32-
27 EXE_POSTFIX =
28 CP = cp
29 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
30 RM = rm
31 DOSCLI = no
32 FLOPPY_DIR = /mnt/floppy
33 # DIST_DIR should be relative from the top of the tree
34 DIST_DIR = dist
35 SEP = /
36 endif
37
38
39 ifeq ($(HOST),mingw32-windows)
40 PREFIX =
41 EXE_POSTFIX = .exe
42 CP = copy
43 DLLTOOL = $(PREFIX)dlltool --as=$(PREFIX)as
44 RM = del
45 DOSCLI = yes
46 FLOPPY_DIR = A:
47 # DIST_DIR should be relative from the top of the tree
48 DIST_DIR = dist
49 SEP = \$($EMPTY_VAR)
50 endif
51
52 # Set INSTALL_DIR to default value if not already set
53 # ifeq ($(INSTALL_DIR),)
54 INSTALL_DIR = $(PATH_TO_TOP)/reactos
55 # endif
56
57 #
58 # Create variables for all the compiler tools
59 #
60 ifeq ($(WITH_DEBUGGING),yes)
61 DEBUGGING_CFLAGS = -g
62 else
63 DEBUGGING_CFLAGS =
64 endif
65
66 ifeq ($(WARNINGS_ARE_ERRORS),yes)
67 EXTRA_CFLAGS = -Werror
68 endif
69
70 DEFINES = -DDBG
71
72 ifeq ($(WIN32_LEAN_AND_MEAN),yes)
73 LEAN_AND_MEAN_DEFINE = -DWIN32_LEAN_AND_MEAN
74 else
75 LEAN_AND_MEAN_DEFINE =
76 endif
77
78 CPP = $(PREFIX)g++
79 CC = $(PREFIX)gcc
80 NATIVE_CC = gcc
81 CFLAGS = \
82 $(BASE_CFLAGS) \
83 -pipe \
84 -O2 \
85 -Wall \
86 -Wstrict-prototypes \
87 -fno-builtin \
88 $(LEAN_AND_MEAN_DEFINE) \
89 $(DEFINES) \
90 $(DEBUGGING_CFLAGS) \
91 $(EXTRA_CFLAGS)
92 CXXFLAGS = $(CFLAGS)
93 LD = $(PREFIX)ld
94 NM = $(PREFIX)nm
95 OBJCOPY = $(PREFIX)objcopy
96 STRIP = $(PREFIX)strip
97 AS = $(PREFIX)gcc -c -x assembler-with-cpp
98 AR = $(PREFIX)ar
99 RC = $(PREFIX)windres
100 RCINC = --include-dir $(PATH_TO_TOP)/../reactos/include
101 TOOLS_PATH = $(PATH_TO_TOP)/../reactos/tools
102 RSYM = $(TOOLS_PATH)/rsym
103
104 %.o: %.cpp
105 $(CPP) $(CFLAGS) -c $< -o $@
106 %.o: %.cc
107 $(CPP) $(CFLAGS) -c $< -o $@
108 %.o: %.c
109 $(CC) $(CFLAGS) -c $< -o $@
110 %.o: %.asm
111 $(NASM_CMD) $(NFLAGS) $< -o $@
112 %.coff: %.rc
113 $(RC) $(RCFLAGS) $(RCINC) $< $@
114
115
116
117 RULES_MAK_INCLUDED = 1