File: Makefile

package info (click to toggle)
semweb 1.05%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,988 kB
  • ctags: 2,832
  • sloc: cs: 14,483; makefile: 180; sh: 107; perl: 20; ansic: 7
file content (159 lines) | stat: -rw-r--r-- 5,777 bytes parent folder | download | duplicates (3)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
VERSION=1.05
    # don't forget to update src/AssemblyInfo.cs!!

########################

# Some checks to see if dependenies are available for
# optional assemblies.

npgsql_available := $(shell gacutil -l Npgsql | grep -c PublicKeyToken)
sqlite_available := $(shell gacutil -l Mono.Data.SqliteClient | grep -c PublicKeyToken)
mysql_available := $(shell gacutil -l MySql.Data | grep -c PublicKeyToken)

########################

# If PROFILE is empty, then our default target is to
# shell out a make for each profile.  Otherwise, we
# just build the profile we're given.  Since we can't
# build any of the .NET target files without a PROFILE,
# those targets are in the else condition.
ifeq "$(PROFILE)" ""

all:
	PROFILE=DOTNET1 make
	PROFILE=DOTNET2 make
#	PROFILE=SILVERLIGHT make
#	PROFILE=DOTNET3 make

# If we have a PROFILE specified.
else

ifeq "$(PROFILE)" "DOTNET1"
BIN=bin
MCS=mcs -d:DOTNET1
endif

ifeq "$(PROFILE)" "DOTNET2"
BIN=bin_generics
MCS=gmcs -d:DOTNET2
endif

ifeq "$(PROFILE)" "DOTNET3"
BIN=bin_linq
MCS=gmcs -d:DOTNET3 -langversion:linq
endif

ifeq "$(PROFILE)" "SILVERLIGHT"
BIN=bin_silverlight
MCS=smcs -d:SILVERLIGHT
endif

all: $(BIN)/SemWeb.dll $(BIN)/SemWeb.PostgreSQLStore.dll $(BIN)/SemWeb.MySQLStore.dll $(BIN)/SemWeb.SqliteStore.dll $(BIN)/SemWeb.SQLServerStore.dll $(BIN)/SemWeb.Sparql.dll $(BIN)/rdfstorage.exe $(BIN)/rdfquery.exe $(BIN)/euler.exe

# Core Library
	
MAIN_SOURCES = \
	src/AssemblyInfo.cs \
	src/NamespaceManager.cs src/Util.cs src/UriMap.cs \
	src/Resource.cs src/Statement.cs \
	src/Interfaces.cs \
	src/Store.cs src/MemoryStore.cs src/SQLStore.cs \
	src/RdfReader.cs src/RdfXmlReader.cs src/N3Reader.cs \
	src/RdfWriter.cs src/RdfXmlWriter.cs src/N3Writer.cs \
	src/Query.cs src/GraphMatch.cs src/LiteralFilters.cs \
	src/Inference.cs src/RDFS.cs src/Euler.cs src/SpecialRelations.cs \
	src/Algos.cs src/SparqlClient.cs

$(BIN)/SemWeb.dll: $(MAIN_SOURCES) Makefile
	mkdir -p $(BIN)
	$(MCS) -debug $(MAIN_SOURCES) -out:$(BIN)/SemWeb.dll -t:library \
		-r:System.Data -r:System.Web

# Auxiliary Assemblies

$(BIN)/SemWeb.Sparql.dll: src/SparqlEngine.cs src/SparqlProtocol.cs
	$(MCS) -debug src/SparqlEngine.cs src/SparqlProtocol.cs -out:$(BIN)/SemWeb.Sparql.dll \
		-t:library -r:$(BIN)/SemWeb.dll -r:$(BIN)/sparql-core.dll -r:$(BIN)/IKVM.GNU.Classpath.dll \
		-r:System.Web

$(BIN)/SemWeb.PostgreSQLStore.dll: src/PostgreSQLStore.cs
ifneq "$(npgsql_available)" "0"
	$(MCS) -debug src/PostgreSQLStore.cs -out:$(BIN)/SemWeb.PostgreSQLStore.dll -t:library \
		-r:$(BIN)/SemWeb.dll -r:System.Data -r:Npgsql
else
	@echo "SKIPPING compilation of SemWeb.PosgreSQLStore.dll because Npgsql assembly seems to be not available in the GAC.";
endif

$(BIN)/SemWeb.SqliteStore.dll: src/SQLiteStore.cs
ifneq "$(sqlite_available)" "0"
	$(MCS) -debug src/SQLiteStore.cs -out:$(BIN)/SemWeb.SqliteStore.dll -t:library \
		-r:$(BIN)/SemWeb.dll -r:System.Data -r:Mono.Data.SqliteClient
else
	@echo "SKIPPING compilation of SemWeb.SqliteStore.dll because Mono.Data.SqliteClient assembly seems to be not available in the GAC.";
endif
	
$(BIN)/SemWeb.MySQLStore.dll: src/MySQLStore.cs
ifneq "$(PROFILE)" "DOTNET1" # the MySql.Data lib we are compiling against is 2.0.
ifneq "$(mysql_available)" "0"
	$(MCS) -debug src/MySQLStore.cs -out:$(BIN)/SemWeb.MySQLStore.dll -t:library\
		 -r:$(BIN)/SemWeb.dll -r:System.Data -r:MySql.Data -d:CONNECTOR -lib:lib
	#$(MCS) -debug src/MySQLStore.cs -out:$(BIN)/SemWeb.MySQLStore-ByteFX.dll -t:library\
	# -r:$(BIN)/SemWeb.dll -r:System.Data -r:ByteFX.Data -d:BYTEFX
else
	@echo "SKIPPING compilation of SemWeb.MySQLStore.dll because MySql.Data assembly seems to be not available in the GAC.";
endif
endif

$(BIN)/SemWeb.SQLServerStore.dll: src/SQLServerStore.cs
	$(MCS) -debug src/SQLServerStore.cs -out:$(BIN)/SemWeb.SQLServerStore.dll -t:library\
		 -r:$(BIN)/SemWeb.dll -r:System.Data

# Utility programs

$(BIN)/rdfstorage.exe: tools/rdfstorage.cs
	$(MCS) -debug tools/rdfstorage.cs -out:$(BIN)/rdfstorage.exe -r:$(BIN)/SemWeb.dll -r:Mono.GetOptions
	
$(BIN)/rdfquery.exe: tools/rdfquery.cs
	$(MCS) -debug tools/rdfquery.cs -out:$(BIN)/rdfquery.exe -r:$(BIN)/SemWeb.dll -r:$(BIN)/SemWeb.Sparql.dll -r:Mono.GetOptions	

$(BIN)/euler.exe: tools/euler.cs
	$(MCS) -debug tools/euler.cs -out:$(BIN)/euler.exe -r:$(BIN)/SemWeb.dll -r:$(BIN)/SemWeb.Sparql.dll

endif
# that's the end of the test if we have a PROFILE given

# Generating documentation files

apidocxml: Makefile
	monodocer \
		-assembly:bin_generics/SemWeb.dll -assembly:bin_generics/SemWeb.Sparql.dll \
		-path:apidocxml --delete --pretty
	#mono /usr/lib/monodoc/monodocs2slashdoc.exe doc > SemWeb.docs.xml
	mkdir -p apidocs
	monodocs2html -source:apidocxml -dest:apidocs -template:docstemplate.xsl

# Generating the release package

package: all
	rm -rf package-workspace
	mkdir -p package-workspace/semweb-$(VERSION)
	cp -R bin bin_generics bin_silverlight src tools apidocs doc \
		ChangeLog Makefile README.txt semweb.mds semweb.sln \
		package-workspace/semweb-$(VERSION)
	mkdir package-workspace/semweb-$(VERSION)/examples
	cp examples/*.cs examples/Makefile examples/README.txt examples/getsomedata.sh \
		package-workspace/semweb-$(VERSION)/examples
	tar -czf packages/semweb-$(VERSION).tgz -C package-workspace \
		--exclude .svn \
		semweb-$(VERSION)
	rm -f packages/semweb.zip
	cd package-workspace/semweb-$(VERSION); cp -R ../../apidocxml monodoc; zip -r -q ../../packages/semweb.zip * -x "*.svn*"
	rm -rf package-workspace
	
deploy: package
	scp packages/semweb-$(VERSION).tgz packages/semweb.zip occams.info:www/code/semweb

clean:
	rm bin*/SemWeb.dll* bin*/SemWeb.Sparql.dll* \
	bin*/SemWeb.PostgreSQLStore.dll* bin*/SemWeb.SqliteStore.dll* bin*/SemWeb.MySQLStore.dll* \
	bin*/rdfstorage.exe* bin*/rdfquery.exe* bin*/euler.exe*