summaryrefslogtreecommitdiffstats
path: root/private/newsam/makefil0
blob: 35960958c6fc20602691514eb548f65fed3f7d6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# This is the MIDL compile phase of the build process.
#
# The following symbols should be defined in your environment:
#       NOTE: This file is designed to provide separate generation
#             of client and server stubs.  Right now, it uses an
#             .acf for only the client stub generation.  However,
#             lines to cause a server .acf file to be used are present
#             but commented out.
# The following is where you put the name of your .idl file without
# the .idl extension:

!INCLUDE $(NTMAKEENV)\makefile.plt

IDL_NAME = samrpc
CLIENT_ACF = samcli.acf
SERVER_ACF = samsrv.acf

CLIENT_INC_FILE = samrpc_c.h
SERVER_INC_FILE = samrpc.h

SDKINC = $(BASEDIR)\public\sdk\inc
SDKCRTINC = $(BASEDIR)\public\sdk\inc\crt
PRIVATEINC = ..\inc

CLIENT_FLAGS = -acf $(CLIENT_ACF) -header $(CLIENT_INC_FILE)
SERVER_FLAGS = -acf $(SERVER_ACF) -header $(SERVER_INC_FILE)
INCS  = -I$(SDKINC)  -I$(SDKCRTINC) -I$(PRIVATEINC)

CLIENT_CPP = -cpp_cmd "$(MIDL_CPP)" $(MIDL_FLAGS)
SERVER_CPP = -cpp_cmd "$(MIDL_CPP)" $(MIDL_FLAGS)

# seperate client and server targets.  The .h file is built by both.

CLIENT_TARGETS = client\$(IDL_NAME)_c.c  \
                 .\client\$(CLIENT_INC_FILE)

SERVER_TARGETS = server\$(IDL_NAME)_s.c  \
                 $(PRIVATEINC)\$(SERVER_INC_FILE)

TARGETS =   $(CLIENT_TARGETS) \
            $(SERVER_TARGETS)

CLIENT_EXTRN_DEPENDS = $(CLIENT_ACF)
EXTRN_DEPENDS = $(CLIENT_EXTRN_DEPENDS)

# Define Products and Dependencies

all:    $(CLIENT_TARGETS) $(SERVER_TARGETS) $(EXTRN_DEPENDS)
!IF "$(BUILDMSG)" != ""
    @ech ; $(BUILDMSG) ;
!ENDIF

clean: delete_source all

delete_source:
    -erase $(TARGETS)

#
# MIDL COMPILE
#

$(CLIENT_TARGETS) : $(IDL_NAME).idl $(CLIENT_EXTRN_DEPENDS)
    copy $(PRIVATEINC)\samimp.h .
    midl -Oi -oldnames -error allocation -error ref -ms_ext -c_ext $(CLIENT_CPP)  $(CLIENT_FLAGS) $(IDL_NAME).idl $(INCS)
    IF EXIST $(IDL_NAME)_c.c copy $(IDL_NAME)_c.c .\client & del  $(IDL_NAME)_c.c
    IF EXIST $(IDL_NAME)_s.c del  $(IDL_NAME)_s.c
    IF EXIST $(CLIENT_INC_FILE)   copy $(CLIENT_INC_FILE) .\client & del  $(CLIENT_INC_FILE)

#$(SERVER_TARGETS) : $(IDL_NAME).idl $(SERVER_EXTRN_DEPENDS)
$(SERVER_TARGETS) : $(IDL_NAME).idl
    IF EXIST .\inc\$(IDL_NAME).h del  .\inc\$(IDL_NAME).h
    IF EXIST .\server\$(IDL_NAME).h del  .\server\$(IDL_NAME).h
    copy $(PRIVATEINC)\samimp.h .
    midl -oldnames -error allocation -error ref -ms_ext -c_ext $(SERVER_CPP) $(SERVER_FLAGS) $(IDL_NAME).idl $(INCS)
    IF EXIST $(IDL_NAME)_c.c del  $(IDL_NAME)_c.c
    IF EXIST $(IDL_NAME)_s.c copy $(IDL_NAME)_s.c .\server & del  $(IDL_NAME)_s.c
    IF EXIST $(SERVER_INC_FILE) copy $(SERVER_INC_FILE)  $(PRIVATEINC) & del  $(SERVER_INC_FILE)