More work on winsock stack (ping is now working)
[reactos.git] / reactos / drivers / net / afd / makefile
1 # AFD.SYS - Ancillary Function Driver
2
3 PATH_TO_TOP = ../../..
4
5 TARGETNAME=afd
6
7 CFLAGS = -I./include -DDBG
8
9 RESOURCE_OBJECT = $(TARGETNAME).coff
10 AFD_OBJECTS = afd/afd.o afd/dispatch.o afd/event.o afd/opnclose.o afd/rdwr.o \
11 afd/routines.o afd/tdi.o
12
13 all: $(TARGETNAME).sys
14
15 $(TARGETNAME).coff: $(TARGETNAME).rc ../../../include/reactos/resource.h
16
17 OBJECTS = $(AFD_OBJECTS) $(RESOURCE_OBJECT) ../../../ntoskrnl/ntoskrnl.a
18
19
20 ifeq ($(DOSCLI),yes)
21 CLEAN_FILES = afd\*.o $(TARGETNAME).coff \
22 junk.tmp base.tmp temp.exp $(TARGETNAME).sys $(TARGETNAME).sym
23 else
24 CLEAN_FILES = afd/*.o $(TARGETNAME).coff $ \
25 junk.tmp base.tmp temp.exp $(TARGETNAME).sys $(TARGETNAME).sym
26 endif
27
28 $(TARGETNAME).sys: $(OBJECTS)
29 $(CC) \
30 -nostartfiles -nostdlib \
31 --subsystem=native \
32 -mdll \
33 --dll \
34 -Wl,-e,_DriverEntry@8 \
35 -Wl,--base-file,base.tmp \
36 -Wl,--defsym,_end=end \
37 -Wl,--defsym,_edata=__data_end__ \
38 -Wl,--defsym,_etext=etext \
39 $(OBJECTS) \
40 -o junk.tmp
41 - $(RM) junk.tmp
42 $(DLLTOOL) \
43 --dllname $(TARGETNAME).sys \
44 --base-file base.tmp \
45 --output-exp temp.exp
46 - $(RM) base.tmp
47 $(CC) \
48 -nostartfiles -nostdlib \
49 --subsystem=native \
50 -mdll \
51 --dll \
52 -Wl,--image-base,0x10000 \
53 -Wl,-e,_DriverEntry@8 \
54 -Wl,temp.exp \
55 $(OBJECTS) \
56 -o $(TARGETNAME).sys
57 - $(RM) temp.exp
58 $(NM) --numeric-sort $(TARGETNAME).sys > $(TARGETNAME).sym
59
60 clean: $(CLEAN_FILES:%=%_clean)
61
62 $(CLEAN_FILES:%=%_clean): %_clean:
63 - $(RM) $*
64
65 .PHONY: clean $(CLEAN_FILES:%=%_clean)
66
67 install: $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
68
69 $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
70 ifeq ($(DOSCLI),yes)
71 $(CP) $(TARGETNAME).sys $(FLOPPY_DIR)\drivers\$(TARGETNAME).sys
72 else
73 $(CP) $(TARGETNAME).sys $(FLOPPY_DIR)/drivers/$(TARGETNAME).sys
74 endif
75
76 dist: $(DIST_DIR)/drivers/$(TARGETNAME).sys
77
78 $(DIST_DIR)/drivers/$(TARGETNAME).sys: $(TARGETNAME).sys
79 ifeq ($(DOSCLI),yes)
80 $(CP) $(TARGETNAME).sys ..\..\..\$(DIST_DIR)\drivers\$(TARGETNAME).sys
81 else
82 $(CP) $(TARGETNAME).sys ../../../$(DIST_DIR)/drivers/$(TARGETNAME).sys
83 endif
84
85 #WITH_DEBUGGING = yes
86 #WIN32_LEAN_AND_MEAN = yes
87 #WARNINGS_ARE_ERRORS = yes
88 include ../../../rules.mak