2007-07-31 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / tools / security / Makefile
1 thisdir = tools/security
2 SUBDIRS = 
3 DIST_ONLY_SUBDIRS = certview
4 include ../../build/rules.make
5
6 LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib/$(PROFILE) -r:Mono.Security.dll
7
8 SECURITY_PROGRAMS = secutil.exe cert2spc.exe sn.exe makecert.exe chktrust.exe \
9         signcode.exe setreg.exe certmgr.exe caspol.exe permview.exe mozroots.exe
10 SECURITY_PROGRAMS_2_0 = httpcfg.exe
11
12 HELPER_SOURCES = AssemblyInfo.cs $(topdir)/build/common/Consts.cs
13 SN_SOURCES = sn.cs StrongNameManager.cs $(HELPER_SOURCES)
14
15 SECURITY_SOURCES = $(HELPER_SOURCES) $(SN_SOURCES) $(SECURITY_PROGRAMS:.exe=.cs) $(SECURITY_PROGRAMS_2_0:.exe=.cs)
16
17 ifeq (default, $(PROFILE))
18 SECURITY_TARGETS = $(SECURITY_PROGRAMS)
19 else
20 SECURITY_TARGETS = $(SECURITY_PROGRAMS_2_0)
21 endif
22
23 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
24
25 DISTFILES = README TESTS $(SECURITY_SOURCES)
26
27 ifeq (net_1_1_bootstrap, $(PROFILE))
28 all-local: $(topdir)/class/lib/$(PROFILE)/sn.exe
29 else
30 all-local: $(SECURITY_TARGETS)
31 endif
32
33 install-local: all-local
34 uninstall-local:
35
36 ifndef NO_INSTALL
37 install-local: $(SECURITY_TARGETS)
38         $(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
39         for p in $(SECURITY_TARGETS) ; do \
40             $(INSTALL_BIN) $$p $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
41             test ! -f $$p.mdb || $(INSTALL_BIN) $$p.mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
42         done
43
44 uninstall-local:
45         for p in $(SECURITY_TARGETS) ; do \
46             rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$$p* ; \
47         done
48 endif
49
50 test-local:
51
52 run-test-local run-test-ondotnet-local:
53
54 clean-local:
55         rm -f *.exe *.mdb *.pdb
56         rm -f $(topdir)/class/lib/$(PROFILE)/sn.exe*
57
58 dist-local: dist-default
59
60 sn.exe $(topdir)/class/lib/$(PROFILE)/sn.exe: $(SN_SOURCES)
61         $(CSCOMPILE) /out:$@ $(SN_SOURCES)
62
63 permview.exe: permview.cs
64         $(CSCOMPILE) $^ $(HELPER_SOURCES) -r:Mono.Cecil.dll
65
66 %.exe: %.cs $(HELPER_SOURCES)
67         $(CSCOMPILE) $^