Little change to make version resource linked in ne2000.sys.
[reactos.git] / reactos / drivers / net / dd / ne2000 / Makefile
1 # $Id: Makefile,v 1.2 2000/09/10 20:00:13 ea Exp $
2 #
3 # NE2000.SYS build spec
4 #
5
6 TARGETNAME=ne2000
7
8 BASE_CFLAGS = -I./include -I../../../../include -DNDIS_MINIPORT_DRIVER
9
10 RESOURCE_OBJECT = $(TARGETNAME).coff
11 NE2000_OBJECTS = ne2000/main.o ne2000/8390.o $(RESOURCE_OBJECT)
12 IMPORT_LIBS = ../../ndis/ndis.a ../../../../ntoskrnl/ntoskrnl.a
13
14
15 all: objects $(TARGETNAME).sys
16
17 objects:
18 mkdir objects
19
20 objects/ne2000.o: $(NE2000_OBJECTS)
21 $(LD) -r $(NE2000_OBJECTS) -o objects/ne2000.o
22
23 OBJECTS = objects/ne2000.o
24
25 $(TARGETNAME).coff: $(TARGETNAME).rc ../../../../include/reactos/resource.h
26
27 ifeq ($(DOSCLI),yes)
28 CLEAN_FILES = \
29 *.o ne2000\*.o objects\*.o $(TARGETNAME).coff \
30 $(TARGETNAME).a junk.tmp base.tmp temp.exp \
31 $(TARGETNAME).sys $(TARGETNAME).sym
32 else
33 CLEAN_FILES = \
34 *.o ne2000\*.o objects/*.o $(TARGETNAME).coff \
35 $(TARGETNAME).a junk.tmp base.tmp temp.exp \
36 $(TARGETNAME).sys $(TARGETNAME).sym
37 endif
38
39
40 $(TARGETNAME).sys: $(OBJECTS) $(TARGETNAME).def
41 $(LD) -r $(OBJECTS) -o $(TARGETNAME).o
42 $(DLLTOOL) \
43 --dllname $(TARGETNAME).sys \
44 --def $(TARGETNAME).def \
45 --output-lib $(TARGETNAME).a \
46 --kill-at
47 $(CC) \
48 -specs=../../../../specs \
49 --subsystem=native \
50 -mdll \
51 --dll \
52 -e _DriverEntry@8 \
53 -o junk.tmp \
54 -Wl,--image-base,0x10000 \
55 -Wl,--file-alignment,0x1000 \
56 -Wl,--section-alignment,0x1000 \
57 -Wl,--defsym,_end=end \
58 -Wl,--defsym,_edata=__data_end__ \
59 -Wl,--defsym,_etext=etext \
60 -Wl,--base-file,base.tmp \
61 $(TARGETNAME).o \
62 $(IMPORT_LIBS)
63 - $(RM) junk.tmp
64 $(DLLTOOL) \
65 --dllname $(TARGETNAME).sys \
66 --base-file base.tmp \
67 --output-exp temp.exp \
68 --def $(TARGETNAME).def \
69 --kill-at
70 - $(RM) base.tmp
71 $(CC) \
72 -specs=../../../../specs \
73 --subsystem=native \
74 -mdll \
75 --dll \
76 -e _DriverEntry@8 \
77 -o $(TARGETNAME).sys \
78 -Wl,--image-base,0x0 \
79 -Wl,--file-alignment,0x1000 \
80 -Wl,--section-alignment,0x1000 \
81 -Wl,--defsym,_end=end \
82 -Wl,--defsym,_edata=__data_end__ \
83 -Wl,--defsym,_etext=etext \
84 -Wl,temp.exp \
85 $(TARGETNAME).o \
86 $(IMPORT_LIBS)
87 - $(RM) temp.exp
88 $(NM) --numeric-sort $(TARGETNAME).sys > $(TARGETNAME).sym
89
90 clean: $(CLEAN_FILES:%=%_clean)
91
92 $(CLEAN_FILES:%=%_clean): %_clean:
93 - $(RM) $*
94
95 .PHONY: clean $(CLEAN_FILES:%=%_clean)
96
97 install: $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
98
99 $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
100 ifeq ($(DOSCLI),yes)
101 $(CP) $(TARGETNAME).sys $(FLOPPY_DIR)\drivers\$(TARGETNAME).sys
102 else
103 $(CP) $(TARGETNAME).sys $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
104 endif
105
106 dist: $(DIST_DIR)/drivers/$(TARGETNAME).sys
107
108 $(DIST_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
109 ifeq ($(DOSCLI),yes)
110 $(CP) $(TARGETNAME).sys ..\..\$(DIST_DIR)\drivers\$(TARGETNAME).sys
111 else
112 $(CP) $(TARGETNAME).sys ../../$(DIST_DIR)/drivers/$(TARGETNAME).sys
113 endif
114
115 #WITH_DEBUGGING = yes
116 #WIN32_LEAN_AND_MEAN = yes
117 #WARNINGS_ARE_ERRORS = yes
118 include ../../../../rules.mak