113712fda4f446d33d36436f6f32260bd61923e9
[reactos.git] / reactos / lib / shell32 / makefile
1 # $Id: makefile,v 1.3 2001/07/15 21:18:55 rex Exp $
2 #
3 # Makefile for ReactOS shell32.dll
4 #
5 PATH_TO_TOP = ../..
6
7 BASE_CFLAGS = -I../../include
8
9 TARGETNAME=shell32
10
11 IMAGE_BASE = 0x77260000
12
13 DLLTARGET=$(TARGETNAME).dll
14
15 MISC_OBJECTS=\
16 misc/dllmain.o \
17 misc/stubs.o
18
19 OBJECTS=\
20 $(MISC_OBJECTS)
21
22 CLEAN_FILES = misc/*.o \
23 $(TARGETNAME).o $(TARGETNAME).a junk.tmp base.tmp temp.exp \
24 $(TARGETNAME).dll $(TARGETNAME).sym $(TARGETNAME).coff
25
26 all: $(DLLTARGET)
27
28 $(TARGETNAME).coff: $(TARGETNAME).rc ../../include/reactos/resource.h
29
30 $(TARGETNAME).a: $(OBJECTS)
31 $(LD) -r $(OBJECTS) -o $(TARGETNAME).a
32
33 $(TARGETNAME).dll: $(DLLMAIN) $(OBJECTS) $(TARGETNAME).def
34 $(LD) -r $(OBJECTS) -o $(TARGETNAME).o
35 $(DLLTOOL) \
36 --dllname $(TARGETNAME).dll \
37 --def $(TARGETNAME).def \
38 --kill-at \
39 --output-lib $(TARGETNAME).a
40 $(CC) \
41 $(TARGETNAME).o \
42 ../ntdll/ntdll.a \
43 ../kernel32/kernel32.a \
44 -nostartfiles \
45 -nostdlib \
46 -mdll \
47 -o junk.tmp \
48 -Wl,--entry=_DllMain@12\
49 -Wl,--base-file,base.tmp
50 - $(RM) junk.tmp
51 $(DLLTOOL) \
52 --dllname $(TARGETNAME).dll \
53 --base-file base.tmp \
54 --output-exp temp.exp \
55 --def $(TARGETNAME).def
56 - $(RM) base.tmp
57 $(CC) \
58 $(TARGETNAME).o \
59 ../ntdll/ntdll.a \
60 ../kernel32/kernel32.a \
61 -nostartfiles \
62 -nostdlib \
63 -mdll \
64 -o $(TARGETNAME).dll \
65 -Wl,--entry=_DllMain@12\
66 -Wl,--image-base,$(IMAGE_BASE) \
67 -Wl,--file-alignment,0x1000 \
68 -Wl,--section-alignment,0x1000 \
69 -Wl,temp.exp
70 - $(RM) temp.exp
71 $(NM) --numeric-sort $(TARGETNAME).dll > $(TARGETNAME).sym
72
73
74 clean:
75 - $(RM) $(CLEAN_FILES)
76
77 .PHONY: clean
78
79 install: $(FLOPPY_DIR)/dlls/$(TARGETNAME).dll
80
81 $(FLOPPY_DIR)/dlls/$(TARGETNAME).dll: $(TARGETNAME).dll
82 $(CP) $(TARGETNAME).dll $(FLOPPY_DIR)/dlls/$(TARGETNAME).dll
83
84
85 dist: $(DIST_DIR)/dlls/$(TARGETNAME).dll
86
87 $(DIST_DIR)/dlls/$(TARGETNAME).dll: $(TARGETNAME).dll
88 $(CP) $(TARGETNAME).dll ../../$(DIST_DIR)/dlls/$(TARGETNAME).dll
89
90
91 include ../../rules.mak
92