-bin/header_keeper:
- mkdir -p bin
- nitc --dir bin src/header_keeper.nit
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+NITC ?= nitc
+NITLS ?= nitls
+NITUNIT ?= nitunit
+NITDOC ?= nitdoc
+
+.PHONY: all
+all: bin/header_keeper
+
+bin/header_keeper: $(shell $(NITLS) -M src/header_keeper.nit)
+ mkdir -p bin/
+ $(NITC) src/header_keeper.nit -o bin/header_keeper
+
+.PHONY: check
check: tests
+ $(NITUNIT) .
+
+.PHONY: tests
tests: bin/header_keeper
gcc -E /usr/include/SDL/SDL_image.h | bin/header_keeper SDL_image.h
gcc -E /usr/include/GLES2/gl2.h | bin/header_keeper gl2.h
+
+.PHONY: doc
+doc:
+ $(NITDOC) . -o doc/
+
+.PHONY: clean
+clean:
+ rm -rf bin/
+ rm -rf doc/
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# See the License for the specific language governing permissions and
# limitations under the License.
-NITC=nitc
-NITC_FLAGS=--dir bin
+NITC ?= nitc
+NITLS ?= nitls
+NITUNIT ?= nitunit
+NITDOC ?= nitdoc
+
NEO4J_DIR=/var/lib/neo4j
OLD_PWD=${PWD}
-.PHONY: bin reset-neo run-tests tests
+.PHONY: all
+all: bin/neo_doxygen
+
+bin/neo_doxygen: $(shell $(NITLS) -M src/neo_doxygen.nit)
+ mkdir -p bin/
+ $(NITC) src/neo_doxygen.nit -o bin/neo_doxygen
-# Compile the tool.
-bin:
- mkdir -p bin
- $(NITC) $(NITC_FLAGS) src/neo_doxygen.nit
+.PHONY: check
+check:
+ $(NITUNIT) .
# Reset the local graph.
+.PHONY: reset-neo
reset-neo:
sudo -u neo4j "${NEO4J_DIR}/bin/neo4j" stop \
- && sudo -u neo4j rm -rf "${NEO4J_DIR}/data/graph.db" \
- && sudo -u neo4j "${NEO4J_DIR}/bin/neo4j" start
+ && sudo -u neo4j rm -rf "${NEO4J_DIR}/data/graph.db" \
+ && sudo -u neo4j "${NEO4J_DIR}/bin/neo4j" start
# Regenerate the XML documents in `tests`.
+.PHONY: tests
tests:
$(MAKE) -C tests
# Run the tests.
+.PHONY: run-tests
run-tests:
cd ../../tests; \
- ./tests.sh ../contrib/neo_doxygen/src/tests/neo_doxygen_*.nit ; \
- cd "${OLD_PWD}"
+ ./tests.sh ../contrib/neo_doxygen/src/tests/neo_doxygen_*.nit ; \
+ cd "${OLD_PWD}"
+
+.PHONY: doc
+doc:
+ $(NITDOC) . -o doc/
+
+.PHONY: clean
+clean:
+ rm -rf bin/
+ rm -rf doc/
-all:
- mkdir -p bin
- nitc --semi-global nitin.nit -m readline -o bin/nitin
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+NITC ?= nitc
+NITLS ?= nitls
+NITUNIT ?= nitunit
+NITDOC ?= nitdoc
+
+.PHONY: all
+all: bin/nitin
+
+bin/nitin: $(shell $(NITLS) -M nitin.nit)
+ mkdir -p bin/
+ $(NITC) --semi-global nitin.nit -m readline -o bin/nitin
+
+.PHONY: check
+check:
+ $(NITUNIT) .
+
+.PHONY: doc
+doc:
+ $(NITDOC) . -o doc/
+
+.PHONY: clean
+clean:
+ rm -rf bin/
+ rm -rf doc/
-all: nitiwiki bin/nitiwiki_server
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
-nitiwiki:
- mkdir -p bin
- nitc src/nitiwiki.nit -o bin/nitiwiki
+NITC ?= nitc
+NITLS ?= nitls
+NITUNIT ?= nitunit
+NITDOC ?= nitdoc
-bin/nitiwiki_server: $(shell nitls -M src/wiki_edit.nit)
- nitc -o $@ src/wiki_edit.nit
+.PHONY: all
+all: bin/nitiwiki bin/wiki_edit
-check: nitiwiki
+bin/nitiwiki: $(shell $(NITLS) -M src/nitiwiki.nit)
+ mkdir -p bin/
+ $(NITC) src/nitiwiki.nit -o bin/nitiwiki
+
+bin/wiki_edit: $(shell $(NITLS) -M src/wiki_edit.nit)
+ mkdir -p bin/
+ $(NITC) src/wiki_edit.nit -o bin/wiki_edit
+
+.PHONY: check
+check: bin/nitiwiki
+ $(NITUNIT) .
cd tests; make
+.PHONY: doc
doc:
- nitdoc -d doc src/nitiwiki.nit
+ $(NITDOC) . -o doc/
+.PHONY: clean
clean:
- rm -rf bin
+ rm -rf bin/
+ rm -rf doc/
# This file is part of NIT ( http://www.nitlanguage.org ).
#
-# Copyright 2014-2015 Alexandre Terrasa <alexandre@moz-code.org>
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# See the License for the specific language governing permissions and
# limitations under the License.
-NITC=nitc
-NITU=nitunit
+NITC ?= nitc
+NITLS ?= nitls
+NITUNIT ?= nitunit
+NITDOC ?= nitdoc
-all: listener web
+.PHONY: all
+all: bin/listener bin/web
-listener:
- $(NITC) src/listener.nit
+bin/listener: $(shell $(NITLS) -M src/listener.nit)
+ mkdir -p bin/
+ $(NITC) src/listener.nit -o bin/listener
-web:
- $(NITC) src/web.nit
+bin/web: $(shell $(NITLS) -M src/web.nit)
+ mkdir -p bin/
+ $(NITC) src/web.nit -o bin/web
+.PHONY: check
check:
- $(NITU) src/game.nit
- $(NITU) src/events.nit
- $(NITU) src/statistics.nit
- $(NITU) src/achievements.nit
- $(NITU) src/listener.nit
+ $(NITUNIT) .
+
+.PHONY: doc
+doc:
+ $(NITDOC) . -o doc/
+.PHONY: clean
clean:
- rm listener web
+ rm -rf bin/
+ rm -rf doc/
# This file is part of NIT ( http://www.nitlanguage.org ).
#
-# Copyright 2015 Alexandre Terrasa <alexandre@moz-code.org>
-#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# See the License for the specific language governing permissions and
# limitations under the License.
-all: refund
+NITC ?= nitc
+NITLS ?= nitls
+NITUNIT ?= nitunit
+NITDOC ?= nitdoc
+
+.PHONY: all
+all: bin/refund
-refund:
- mkdir -p bin
- nitc src/refund.nit -o bin/refund
+bin/refund: $(shell $(NITLS) -M src/refund.nit)
+ mkdir -p bin/
+ $(NITC) src/refund.nit -o bin/refund
-check: refund
+.PHONY: check
+check: bin/refund
+ $(NITUNIT) .
cd tests; make
+.PHONY: doc
+doc:
+ $(NITDOC) . -o doc/
+
+.PHONY: clean
clean:
- rm -rf bin
+ rm -rf bin/
+ rm -rf doc/
cd tests; make clean
-build:
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+NITC ?= nitc
+NITLS ?= nitls
+NITUNIT ?= nitunit
+NITDOC ?= nitdoc
+
+.PHONY: all
+all: bin/sort_downloads
+
+bin/sort_downloads: $(shell $(NITLS) -M src/sort_downloads.nit)
mkdir -p bin/
- nitc --dir bin/ src/*.nit
+ $(NITC) src/sort_downloads.nit -o bin/sort_downloads
+.PHONY: install
install:
install bin/sort_downloads /usr/local/bin/
+
+.PHONY: check
+check:
+ $(NITUNIT) .
+
+.PHONY: doc
+doc:
+ $(NITDOC) . -o doc/
+
+.PHONY: clean
+clean:
+ rm -rf bin/
+ rm -rf doc/