summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 34 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index feef0bf0..92444a30 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,16 @@
 NAME = ranger
 VERSION = 1.0.3
-PYTHON = python
-DOCDIR = doc/pydoc
+PYTHON ?= python
+DOCDIR ?= doc/pydoc
+PREFIX ?= /usr/local
+PYTHONOPTIMIZE ?= 1
 CWD = $(shell pwd)
-EDITOR = vim
+EDITOR ?= vim
+DEST ?= $(shell $(PYTHON) -c 'import sys; sys.stdout.write( \
+	[p for p in sys.path if "site" in p][0])' 2> /dev/null)/ranger
 
-.PHONY: all clean doc cleandoc edit push test commit install info snapshot minimal_snapshot
+.PHONY: all compile clean doc cleandoc edit push test commit \
+	install uninstall info snapshot minimal_snapshot
 
 info:
 	@echo 'This makefile provides shortcuts for common tasks.'
@@ -21,7 +26,11 @@ info:
 	@echo 'make push: push the changes via git'
 	@echo 'make edit: open all relevant files in your editor'
 
-all: test
+all: test install
+
+compile: clean
+	@echo 'Compiling...'
+	PYTHONOPTIMIZE=$(PYTHONOPTIMIZE) python -m compileall -q ranger
 
 doc: cleandoc
 	mkdir -p $(DOCDIR)
@@ -30,8 +39,26 @@ doc: cleandoc
 		sys.path[0] = "$(CWD)"; \
 		pydoc.writedocs("$(CWD)")'
 
-install:
-	@less -XF INSTALL
+uninstall:
+	@echo 'To uninstall ranger, please remove these files:'
+	@echo $(DEST)'/*'
+	@echo $(PREFIX)'/bin/ranger'
+	@echo 'and optionally the config files at:'
+	@echo '~/.ranger'
+
+install: compile
+	@echo "Installing..."
+	cp ranger.py $(PREFIX)/bin/ranger
+	cp -ruT ranger $(DEST)
+	@echo '--------------------------------------'
+	@echo 'Finished.'
+	@echo 'If you use BASH or ZSH, you can activate an extra feature now:'
+	@echo 'When you exit ranger, the directory of the current shell can be'
+	@echo 'changed to the last visited directory in ranger.  To do so, add'
+	@echo 'this alias to your shell rc file (like ~/.bashrc):'
+	@echo 'alias rng="source ranger ranger"'
+	@echo 'And run ranger by typing rng.'
+
 
 cleandoc:
 	test -d $(DOCDIR) && rm -f -- $(DOCDIR)/*.html
ont-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/sh
# Hackily check for certain kinds of errors.
#
# We still rely exclusively on linux/bootstrap/bootstrap for some static
# checks on bare SubX code that aren't implemented yet in the self-hosted
# translator phases.
#
# However, boot.subx uses instructions that bootstrap doesn't recognize. So we
# won't check it.

set -e

cat $* [0-9]*.mu                                      |linux/mu      > a.subx

cat misc_checks.subx mu-init.subx [0-9]*.subx a.subx  |linux/braces  > a.braces
cat a.braces                                          |linux/calls   > a.calls
cat a.calls                                           |linux/sigils  > a.sigils

CXXFLAGS=-g linux/bootstrap/bootstrap --debug translate a.sigils -o a.elf
# Translation will never succeed,
# but if we get to "missing reference to global" errors, they're expected and
# we've gotten to the end of what bootstrap can check for us.
='n253' href='#n253'>253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474