summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2001-01-24 16:36:06 +0000
committerleo2001-01-24 16:36:06 +0000
commit789d7a2a8eabb75bdc7d13d34b07bc219252b084 (patch)
tree5c0fd4cd89e77f1a71d4278dcb0e1f895ce4cb74
parent04f9a98690d8de6571151a624ce2eb324c51ec5b (diff)
Set paths from the config target
git-svn-id: http://svn.leocad.org/trunk@226 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--Makefile8
-rw-r--r--config.mk20
2 files changed, 22 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index aeca41a..dfa7b56 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ bin:
### include the C/C++ include
### dependencies
-ifeq ($(findstring $(MAKECMDGOALS), config clean veryclean spotless), )
+ifeq ($(findstring $(MAKECMDGOALS), help config-help config clean veryclean spotless), )
-include $(OBJ:.o=.d)
endif
@@ -103,8 +103,10 @@ arch:
mkdir arch
install: $(BIN)
- install -c -m 0755 $(BIN) $(PREFIX)/bin
- install -c -m 0644 docs/leocad.1 $(PREFIX)/man/man1
+ install -d $(DESTDIR)$(PREFIX)/bin
+ install -d $(DESTDIR)$(PREFIX)/share/man/man1
+ install -c -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin/
+ install -c -m 0644 docs/leocad.1 $(DESTDIR)$(PREFIX)/share/man/man1/
binary: binary-zip binary-tgz
diff --git a/config.mk b/config.mk
index 07bc10a..58ba63d 100644
--- a/config.mk
+++ b/config.mk
@@ -22,7 +22,6 @@ ifeq ($(shell uname), Linux)
OS := -DLC_LINUX
OSDIR := linux
-PREFIX := /usr/local
GTK_CONFIG := gtk-config
endif
@@ -33,7 +32,6 @@ ifeq ($(shell uname), FreeBSD)
OS := -DLC_LINUX
OSDIR := linux
-PREFIX := /usr/local
GTK_CONFIG := gtk12-config
CPPFLAGS += -L/usr/local/lib
@@ -48,7 +46,20 @@ OSDIR := beos
endif
-.PHONY: config
+### Default directory
+
+ifeq ($(PREFIX), )
+PREFIX := /usr/local
+endif
+
+.PHONY: config config-help
+
+config-help:
+ @echo "This target attempts to detect your system settings,"
+ @echo "it will create $(OSDIR)/config.mk and $(OSDIR)/config.h"
+ @echo "Valid parameters and their default values are:"
+ @echo " PREFIX=/usr/local"
+ @echo " DESTDIR="
### Automatic configuration
@@ -58,6 +69,9 @@ config:
@echo "### LeoCAD configuration" > $(OSDIR)/config.mk
@echo "### Auto-generated file, DO NOT EDIT" >> $(OSDIR)/config.mk
@echo "" >> $(OSDIR)/config.mk
+ @echo "PREFIX := $(PREFIX)" >> $(OSDIR)/config.mk;
+ @echo "DESTDIR := $(DESTDIR)" >> $(OSDIR)/config.mk;
+ @echo "" >> $(OSDIR)/config.mk
@echo "//" > $(OSDIR)/config.h
@echo "// LeoCAD configuration" >> $(OSDIR)/config.h