24541
|
1 include ../../config.mak
|
|
2
|
|
3 all: dhasetup.exe dhahelper.sys
|
|
4
|
|
5 dhasetup.exe: dhasetup.c
|
24548
|
6 $(CC) -o $@ $<
|
24541
|
7
|
|
8 dhahelper.o: dhahelper.c dhahelper.h
|
24548
|
9 $(CC) -Wall -Os -c $< -o $@
|
24541
|
10
|
|
11 dhahelper-rc.o: dhahelper.rc common.ver ntverp.h
|
24548
|
12 windres -I. $< $@
|
24541
|
13
|
|
14 base.tmp: dhahelper.o dhahelper-rc.o
|
24548
|
15 $(CC) -Wl,--base-file,$@ \
|
24541
|
16 -Wl,--entry,_DriverEntry@8 \
|
|
17 -nostartfiles -nostdlib \
|
24548
|
18 -o junk.tmp $^ -lntoskrnl
|
24541
|
19 -rm -f junk.tmp
|
|
20
|
|
21 temp.exp: base.tmp
|
24548
|
22 dlltool --dllname dhahelper.sys --base-file $< --output-exp $@
|
24541
|
23
|
24548
|
24 dhahelper.sys: temp.exp dhahelper.o dhahelper-rc.o
|
24541
|
25 $(CC) -Wl,--subsystem,native \
|
|
26 -Wl,--image-base,0x10000 \
|
|
27 -Wl,--file-alignment,0x1000 \
|
|
28 -Wl,--section-alignment,0x1000 \
|
|
29 -Wl,--entry,_DriverEntry@8 \
|
24548
|
30 -Wl,$< \
|
24541
|
31 -mdll -nostartfiles -nostdlib \
|
24548
|
32 -o $@ dhahelper.o dhahelper-rc.o \
|
24541
|
33 -lntoskrnl
|
24548
|
34 strip $@
|
24541
|
35
|
|
36 clean:
|
|
37 rm -f *.o *~ dhahelper.sys dhasetup.exe base.tmp temp.exp
|
|
38
|
|
39 distclean: clean
|
24549
|
40
|
|
41 .PHONY: all clean distclean
|