Little change to make version resource linked in ne2000.sys.
[reactos.git] / reactos / drivers / net / ndis / Makefile
1 # NDIS.SYS - NDIS library
2
3 TARGETNAME=ndis
4
5 BASE_CFLAGS = -I./include -I../../../include -DNDIS_WRAPPER -DBINARY_COMPATIBLE=1
6
7 RESOURCE_OBJECT = $(TARGETNAME).coff
8 NDIS_OBJECTS = ndis/main.o ndis/40gone.o ndis/50gone.o ndis/buffer.o ndis/cl.o \
9 ndis/cm.o ndis/co.o ndis/control.o ndis/hardware.o \
10 ndis/io.o ndis/memory.o ndis/miniport.o \
11 ndis/protocol.o ndis/string.o ndis/stubs.o ndis/time.o \
12 $(TARGETNAME).coff
13
14 all: objects $(TARGETNAME).sys
15
16 objects:
17 mkdir objects
18
19 $(TARGETNAME).coff: $(TARGETNAME).rc ../../../include/reactos/resource.h
20
21 OBJECTS = $(NDIS_OBJECTS) $(RESOURCE_OBJECT) ../../../ntoskrnl/ntoskrnl.a
22
23
24 ifeq ($(DOSCLI),yes)
25 CLEAN_FILES = *.o objects\*.o ndis\*.o $(TARGETNAME).coff $(TARGETNAME).o $(TARGETNAME).a \
26 junk.tmp base.tmp temp.exp $(TARGETNAME).sys $(TARGETNAME).sym
27 else
28 CLEAN_FILES = *.o objects/*.o ndis/*.o $(TARGETNAME).coff $(TARGETNAME).o $(TARGETNAME).a \
29 junk.tmp base.tmp temp.exp $(TARGETNAME).sys $(TARGETNAME).sym
30 endif
31
32 $(TARGETNAME).sys: $(OBJECTS)
33 $(DLLTOOL) \
34 --dllname $(TARGETNAME).sys \
35 --def $(TARGETNAME).def \
36 --kill-at \
37 --output-lib $(TARGETNAME).a
38 $(CC) \
39 -mdll \
40 -specs=../../svc_specs \
41 -Wl,-e,_DriverEntry@8 \
42 -Wl,--base-file,base.tmp \
43 -Wl,--defsym,_end=end \
44 -Wl,--defsym,_edata=__data_end__ \
45 -Wl,--defsym,_etext=etext \
46 $(OBJECTS) \
47 -o junk.tmp
48 - $(RM) junk.tmp
49 $(DLLTOOL) \
50 --dllname $(TARGETNAME).sys \
51 --base-file base.tmp \
52 --output-exp temp.exp \
53 --def $(TARGETNAME).edf
54 - $(RM) base.tmp
55 $(CC) \
56 -mdll \
57 -specs=../../svc_specs \
58 -Wl,--image-base,0x10000 \
59 -Wl,-e,_DriverEntry@8 \
60 -Wl,temp.exp \
61 $(OBJECTS) \
62 -o $(TARGETNAME).sys
63 - $(RM) temp.exp
64 $(NM) --numeric-sort $(TARGETNAME).sys > $(TARGETNAME).sym
65
66 clean: $(CLEAN_FILES:%=%_clean)
67
68 $(CLEAN_FILES:%=%_clean): %_clean:
69 - $(RM) $*
70
71 .PHONY: clean $(CLEAN_FILES:%=%_clean)
72
73 install: $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
74
75 $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
76 ifeq ($(DOSCLI),yes)
77 $(CP) $(TARGETNAME).sys $(FLOPPY_DIR)\drivers\$(TARGETNAME).sys
78 else
79 $(CP) $(TARGETNAME).sys $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
80 endif
81
82 dist: $(DIST_DIR)/drivers/$(TARGETNAME).sys
83
84 $(DIST_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
85 ifeq ($(DOSCLI),yes)
86 $(CP) $(TARGETNAME).sys ..\..\..\$(DIST_DIR)\drivers\$(TARGETNAME).sys
87 else
88 $(CP) $(TARGETNAME).sys ../../../$(DIST_DIR)/drivers/$(TARGETNAME).sys
89 endif
90
91 #WITH_DEBUGGING = yes
92 #WIN32_LEAN_AND_MEAN = yes
93 #WARNINGS_ARE_ERRORS = yes
94 include ../../../rules.mak