Fixed broken rule.
[reactos.git] / reactos / drivers / storage / class2 / makefile
1 # $Id: makefile,v 1.2 2001/07/26 12:35:52 ekohl Exp $
2 #
3 #
4 PATH_TO_TOP = ../../..
5
6 TARGET=class2
7
8 OBJECTS = $(TARGET).o $(TARGET).coff
9
10 LIBS = $(PATH_TO_TOP)/ntoskrnl/ntoskrnl.a
11
12 CFLAGS = -D__NTDRIVER__ -I$(PATH_TO_TOP)/include
13
14 all: $(TARGET).sys $(TARGET).sys.unstripped $(TARGET).a
15
16 .phony: all
17
18 clean:
19 - $(RM) *.o $(TARGET).a $(TARGET).coff junk.tmp base.tmp temp.exp $(TARGET).sys $(TARGET).sys.unstripped
20
21 .phony: clean
22
23 install: $(FLOPPY_DIR)/drivers/$(TARGET).sys
24
25 $(FLOPPY_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
26 $(CP) $(TARGET).sys $(FLOPPY_DIR)/drivers/$(TARGET).sys
27
28
29 dist: $(PATH_TO_TOP)/$(DIST_DIR)/drivers/$(TARGET).sys
30
31 $(PATH_TO_TOP)/$(DIST_DIR)/drivers/$(TARGET).sys: $(TARGET).sys
32 $(CP) $(TARGET).sys $(PATH_TO_TOP)/$(DIST_DIR)/drivers/$(TARGET).sys
33
34
35 $(TARGET).a: $(TARGET).def
36 $(DLLTOOL) \
37 --dllname $(TARGET).sys \
38 --def $(TARGET).def \
39 --kill-at \
40 --output-lib $(TARGET).a
41
42 $(TARGET).sys $(TARGET).sys.unstripped: $(OBJECTS) $(LIBS)
43 $(CC) \
44 -nostartfiles -nostdlib -e _DriverEntry@8\
45 -mdll \
46 -o junk.tmp \
47 -Wl,--defsym,_end=end \
48 -Wl,--defsym,_edata=__data_end__ \
49 -Wl,--defsym,_etext=etext \
50 -Wl,--base-file,base.tmp $^
51 - $(RM) junk.tmp
52 $(DLLTOOL) \
53 --dllname $@ \
54 --base-file base.tmp \
55 --output-exp temp.exp \
56 --def $(TARGET).edf \
57 --kill-at
58 - $(RM) base.tmp
59 $(CC) \
60 --verbose \
61 -Wl,--subsystem,native \
62 -Wl,--image-base,0x10000 \
63 -Wl,-e,_DriverEntry@8 \
64 -Wl,temp.exp \
65 -nostartfiles -nostdlib -e _DriverEntry@8 \
66 -mdll \
67 -o $@.unstripped \
68 $^
69 - $(RM) temp.exp
70 - $(NM) --numeric-sort $@.unstripped > $@.sym
71 $(STRIP) --strip-debug $<
72 $(CC) \
73 -nostartfiles -nostdlib -e _DriverEntry@8 \
74 -mdll \
75 -o junk.tmp \
76 -Wl,--defsym,_end=end \
77 -Wl,--defsym,_edata=__data_end__ \
78 -Wl,--defsym,_etext=etext \
79 -Wl,--base-file,base.tmp $^
80 - $(RM) junk.tmp
81 $(DLLTOOL) \
82 --dllname $@ \
83 --base-file base.tmp \
84 --output-exp temp.exp \
85 --def $(TARGET).edf \
86 --kill-at
87 - $(RM) base.tmp
88 $(CC) \
89 --verbose \
90 -Wl,--subsystem,native \
91 -Wl,--image-base,0x10000 \
92 -Wl,-e,_DriverEntry@8 \
93 -Wl,temp.exp \
94 -nostartfiles -nostdlib -e _DriverEntry@8 \
95 -mdll \
96 -o $@ \
97 $^
98 - $(RM) temp.exp
99
100 WARNINGS_ARE_ERRORS = yes
101 include $(PATH_TO_TOP)/rules.mak