X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=Makefile;h=76925a61c96b011da382e53b72ab3f8ac39f3b1b;hp=53f4f963040ef54e6913bb6a75f4b175e9690748;hb=bc025530248c52e31a629b2a8943b2f68e919caa;hpb=f10261e6a15f9a645457f9a63ae2a6236f9c2631 diff --git a/Makefile b/Makefile index 53f4f96..76925a6 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ # where to install -prefix := /usr/local -libdir := $(prefix)/lib -includedir := $(prefix)/include -bindir := $(prefix)/bin -mandir := $(prefix)/man/man1 +PREFIX ?:= /usr/local +libdir := $(PREFIX)/lib +includedir := $(PREFIX)/include +bindir := $(PREFIX)/bin +mandir := $(PREFIX)/man/man1 objects := osl.o util.o rbtree.o sha1.o fsck_objects := fsck.fsck.o osl.fsck.o util.fsck.o rbtree.fsck.o sha1.fsck.o fsck.cmdline.o @@ -12,7 +12,9 @@ executables := oslfsck man_pages := oslfsck.1 INSTALL := install -CC := gcc +ifeq "$(origin CC)" "default" + CC := gcc +endif MKDIR := mkdir -p RM := rm -f LN := ln @@ -56,7 +58,7 @@ ifeq ($(uname_s),Darwin) # Darwin has its own idea on version numbers: realname := lib$(libname).$(x).dylib soname := $(realname) - linkername := lib$(libname).so + linkername := lib$(libname).dylib # The minor version number is an incremental number using the format # X[.Y[.Z]]. To set the minor version number of a dynamic library, use # the gcc -current_version option. @@ -124,7 +126,7 @@ fsck.cmdline.o: fsck.cmdline.c fsck.cmdline.h $(CC) -c $(CPPFLAGS) $(CFLAGS) $(LIBCFLAGS) $< fsck.cmdline.h fsck.cmdline.c: fsck.ggo Makefile - gengetopt $$O \ + gengetopt \ --conf-parser \ --unamed-opts=table \ --no-handle-version \ @@ -168,10 +170,10 @@ distclean: clean rm -rf web/doxygen install: all - $(MKDIR) $(libdir) $(includedir) + $(MKDIR) $(libdir) $(includedir) $(mandir) $(bindir) $(RM) $(libdir)/$(linkername) $(LN) -s $(libdir)/$(soname) $(libdir)/$(linkername) - $(INSTALL) -s -m 755 $(realname) $(libdir) + $(INSTALL) -m 755 $(realname) $(libdir) $(INSTALL) -m 644 $(headers) $(includedir) $(INSTALL) -m 755 $(executables) $(bindir) $(INSTALL) -m 644 $(man_pages) $(mandir)