1#
2#  ReactOS explorer
3#
4#  Makefile-precomp
5#
6#  MinGW Makefile with precompiled header support
7#
8
9CC = gcc
10CXX = g++
11LINK = g++
12
13CFLAGS	= -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -I.
14RCFLAGS	= -DWIN32 -D__WINDRES__
15LFLAGS	= -Wl,--subsystem,windows
16
17ifdef DEBUG
18CFLAGS	+= -D_DEBUG -g
19RCFLAGS	+= -D_DEBUG
20LFLAGS	+= -g
21else
22CFLAGS	+= -DNDEBUG -Os #-march=pentium4
23RCFLAGS	+= -DNDEBUG
24LFLAGS	+= -s
25endif
26
27ifndef UNICODE
28UNICODE = 1
29endif
30
31ifeq ($(UNICODE),1)
32CFLAGS	+= -DUNICODE
33# LFLAGS+= -Wl,--entry,_wWinMain@16
34RCFLAGS += -DUNICODE
35endif
36
37CXXFLAGS = $(CFLAGS)
38
39EXEC_SUFFIX = .exe
40RES_SUFFIX = .coff
41
42VPATH = shell utility taskbar desktop dialogs services
43
44PROGRAM = explorer
45
46TARGET = $(PROGRAM)$(EXEC_SUFFIX)
47
48OBJECTS = \
49	startup.o \
50	shellclasses.o \
51	utility.o \
52	window.o \
53	dragdropimpl.o \
54	shellbrowserimpl.o \
55	shellservices.o \
56	explorer.o \
57	entries.o \
58	winfs.o \
59	unixfs.o \
60	shellfs.o \
61	ntobjfs.o \
62	regfs.o \
63	fatfs.o \
64	webchild.o \
65	mainframe.o \
66	filechild.o \
67	pane.o \
68	shellbrowser.o \
69	desktop.o \
70	desktopbar.o \
71	taskbar.o \
72	startmenu.o \
73	traynotify.o \
74	quicklaunch.o \
75	favorites.o \
76	searchprogram.o \
77	settings.o \
78	i386-stub-win32.o \
79	xmlstorage.o \
80	xs-native.o
81
82LIBS = gdi32 comctl32 msimg32 ole32 uuid
83DELAYIMPORTS = oleaut32 wsock32
84
85all: precomp.h.gch $(TARGET)
86
87precomp.h.gch: *.h utility/*.h shell/*.h desktop/*.h
88	$(CXX) $(CFLAGS) precomp.h
89
90$(TARGET): $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) notifyhook.dll
91	$(LINK) $(LFLAGS) -o $@ $^ $(addprefix -l,$(LIBS)) $(addprefix -l,$(DELAYIMPORTS))
92
93$(PROGRAM)$(RES_SUFFIX): explorer_intres.rc res/*.bmp res/*.ico
94	windres $(RCFLAGS) -o $@ explorer_intres.rc
95
96notifyhook.dll: notifyhook/notifyhook.c notifyhook/notifyhook.h
97	$(CC) -D_WIN32_IE=0x0600 -Wall -D_NOTIFYHOOK_IMPL -Os -s notifyhook/notifyhook.c -shared -o $@
98
99clean:
100	rm -f $(TARGET) $(OBJECTS) $(PROGRAM)$(RES_SUFFIX) precomp.h.gch \
101	desktop/*.o dialogs/*.o shell/*.o taskbar/*.o utility/*.o
102