aboutsummaryrefslogtreecommitdiffstats
path: root/src/build-data/makefile/nmake.in
blob: 6454e46ead7b105fa5b8df073ec2a196988e5627 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
%{header_in}

### Aliases for Common Programs
AR            = %{ar_command}
COPY          = copy
CD            = @cd
ECHO          = @echo
INSTALL       = %{install_cmd_exec}
INSTALL_CMD   = %{install_cmd_exec}
MKDIR         = @md
MKDIR_INSTALL = @md
RM            = @del /Q
RM_R          = $(RM) /S
RMDIR         = @rmdir

# Executable targets
APP           = %{out_dir}\botan%{program_suffix}
TEST          = %{out_dir}\botan-test%{program_suffix}

# Library targets
# LIB_FILENAME is either a static lib or the DLL
LIB_BASENAME  = %{libname}
LIB_FILENAME  = %{out_dir}\$(LIB_BASENAME).%{static_suffix}
LIBRARIES     = $(LIB_FILENAME)

# File Lists
LIBOBJS       = %{lib_objs}

APPOBJS       = %{app_objs}

TESTOBJS      = %{test_objs}

# First make target. Will be used by default
all: $(APP) $(TEST)

# Build Commands
%{lib_build_cmds}

%{app_build_cmds}

%{test_build_cmds}

# Link Commands
$(APP): $(LIBRARIES) $(APPOBJS)
	$(CXX) /Fe$@ $(APPOBJS) $(LIB_FILENAME) $(APP_LINKS_TO)

$(TEST): $(LIBRARIES) $(TESTOBJS)
	$(CXX) /Fe$@ $(TESTOBJS) $(LIB_FILENAME) $(TEST_LINKS_TO)

$(LIB_FILENAME): $(LIBOBJS)
!If "$(SO_OBJ_FLAGS)" == ""
	$(AR) /OUT:$(LIB_FILENAME) $(LIBOBJS)
!Else
	$(LIB_LINK_CMD) /Fe%{out_dir}\$(LIB_BASENAME) $(LIBOBJS) $(LIB_LINKS_TO)
!Endif

# Fake Targets

SPHINX_CONFIG = %{sphinx_config_dir}
SPHINX_OPTS = -b html

docs:
%{build_doc_commands}

clean:
	-$(RM) %{libobj_dir}\*
	-$(RM) %{testobj_dir}\*
	-$(RM) %{appobj_dir}\*
	-$(RM) %{out_dir}\*.manifest
	-$(RM) %{out_dir}\*.exp
	-$(RM) %{out_dir}\*.dll
	-$(RM) $(LIBRARIES) $(APP) $(TEST)

distclean: clean
	$(RM_R) %{build_dir}
	$(RMDIR) %{build_dir}\include\botan\internal
	$(RMDIR) %{build_dir}\include\botan
	$(RMDIR) %{build_dir}\include
	$(RMDIR) %{build_dir}\lib %{build_dir}\tests
	$(RMDIR) %{build_dir}
	$(RM) Makefile $(LIB_BASENAME).* $(APP).*

install: $(APP) docs
	$(SCRIPTS_DIR)\install.py --destdir=%{destdir} --build-dir="%{build_dir}" --bindir=%{bindir} --libdir=%{libdir} --docdir=%{docdir} --includedir=%{includedir}