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