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