aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data/makefile/nmake.in
blob: 0eca6d6b4acfb4cc14bd167146a4c29ccde266a0 (plain)
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
%{header_in}

# Object Files
LIBOBJS       = %{lib_objs}

CLIOBJS       = %{cli_objs}

TESTOBJS      = %{test_objs}

# Build Commands
%{lib_build_cmds}

%{cli_build_cmds}

%{test_build_cmds}


COPY          = copy

docs:
%{build_doc_commands}

# Library targets
#
# LIB_FILENAME is always the .lib file, that is either a static lib or a
# by-product of the DLL creation used to link the DLL into applications
LIB_BASENAME  = %{lib_basename}
LIB_FILENAME  = %{out_dir}\$(LIB_BASENAME).lib

!If "$(SO_OBJ_FLAGS)" == ""
# static lib
LIBRARIES     = $(LIB_FILENAME)
!Else
# shared lib
SO_FILENAME   = %{out_dir}\$(LIB_BASENAME).dll
LIBRARIES     = $(SO_FILENAME)
!Endif

# Link Commands
$(CLI): $(LIBRARIES) $(CLIOBJS)
	$(CLI_LINK_CMD) /OUT:$@ $(CLIOBJS) $(LIB_FILENAME) $(CLI_LINKS_TO)
	$(CLI_POST_LINK_CMD)

$(TEST): $(LIBRARIES) $(TESTOBJS)
	$(TEST_LINK_CMD) /OUT:$@ $(TESTOBJS) $(LIB_FILENAME) $(TEST_LINKS_TO)
	$(TEST_POST_LINK_CMD)

libs: $(LIBRARIES)

!If "$(SO_OBJ_FLAGS)" == ""
# static lib
$(LIB_FILENAME): $(LIBOBJS)
	$(AR) %{ar_options} /OUT:$@ $(LIBOBJS)
!Else
# shared lib
# Creates the DLL $(SO_FILENAME) and the .lib $(LIB_FILENAME)
$(SO_FILENAME): $(LIBOBJS)
	$(LIB_LINK_CMD) /OUT:$@ $(LIBOBJS) $(LIB_LINKS_TO)
!Endif