--- Makefile.orig 2000-01-01 00:00:00.000000000 +1100 +++ Makefile 2013-09-27 22:31:44.000000000 +1000 @@ -11,22 +11,34 @@ # http://www.opensource.org/licenses/cpl1.0.php # -COMPILER = -cc -OPTIONS = -std=c99 -pedantic -Wall -o -OPTIONS_LIBS = -std=c99 -pedantic -Wall -c +PREFIX ?= /opt/local +COMPILER = $(CC) +OPTIONS = $(CFLAGS) -std=c99 -pedantic -Wall -o +OPTIONS_LIBS = $(CFLAGS) -std=c99 -pedantic -Wall -c +VERSION = 0.0.2 +all: GeneralHashFunctions.o HashTest dylib -all: GeneralHashFunctions.o HashTest +dylib: GeneralHashFunctions.o + $(COMPILER) $(LDFLAGS) -dynamiclib -install_name $(PREFIX)/lib/libghash.$(VERSION).dylib -current_version $(VERSION) -o libghash.$(VERSION).dylib GeneralHashFunctions.o GeneralHashFunctions.o: GeneralHashFunctions.c GeneralHashFunctions.h $(COMPILER) $(OPTIONS_LIBS) GeneralHashFunctions.c -HashTest: GeneralHashFunctions.c HashTest.c +HashTest: GeneralHashFunctions.o HashTest.c $(COMPILER) $(OPTIONS) HashTest HashTest.c GeneralHashFunctions.o +test: HashTest + ./HashTest + clean: rm -f core *.o *.bak *stackdump *# +install: + install -m 644 GeneralHashFunctions.h $(DESTDIR)$(PREFIX)/include/libghash.h + install -m 644 libghash.$(VERSION).dylib $(DESTDIR)$(PREFIX)/lib + cd $(DESTDIR)$(PREFIX)/lib && ln -s libghash.$(VERSION).dylib libghash.dylib + # # The End ! -# \ No newline at end of file +#