X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=Makefile;h=7204f88f535053b622048fbb1a0a2b0d80889674;hp=e79390c4ddad37f9d93c624f84c2ecc1984e98c3;hb=491ba5fc4fcc9546ad0aec647b03e73e5542a949;hpb=5952112a37ecdaedf3b76e08f97d307f1056c512 diff --git a/Makefile b/Makefile index e79390c..7204f88 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS") uname_rs := $(shell uname -rs) -objects := osl.o fd.o rbtree.o string.o sha1.o +objects := osl.o fd.o rbtree.o sha1.o major_version := 0 minor_version := 1 patchlevel_version := 0 @@ -13,10 +13,9 @@ ifeq ($(uname_s),Linux) dso_filename :=lib$(libname).so.$(major_version).$(minor_version).$(patchlevel_version) endif ifeq ($(uname_s),Darwin) - mac_major_version := $(shell expr 41 + $(major_version)) dso_opts := -dynamiclib -current_version $(major_version).$(minor_version) \ -compatibility_version $(major_version).$(minor_version) -fvisibility=hidden - dso_filename := lib$(libname).$(shell printf "\\x"$(mac_major_version).dylib) + dso_filename := lib$(libname).$(major_version) endif ifeq ($(uname_s),SunOS) dso_opts := --shared -z text -z defs @@ -33,11 +32,14 @@ ifeq ($(uname_s),NetBSD) endif all: $(dso_filename) +# disallow undefined symbols +LDFLAGS += -Wl,-z,defs + DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W DEBUG_CPPFLAGS += -Wredundant-decls -#CPPFLAGS += -Os +CPPFLAGS += -Os CPPFLAGS += -Wall -#CPPFLAGS += -Wuninitialized +CPPFLAGS += -Wuninitialized CPPFLAGS += -Wchar-subscripts CPPFLAGS += -Wformat-security CPPFLAGS += -Werror-implicit-function-declaration @@ -45,6 +47,7 @@ CPPFLAGS += -Wmissing-format-attribute CPPFLAGS += -Wunused-macros CPPFLAGS += -Wbad-function-cast CPPFLAGS += -fPIC +CPPFLAGS += -fvisibility=hidden Makefile.deps: $(wildcard *.c *.h) gcc -MM -MG *.c > $@ @@ -54,7 +57,17 @@ Makefile.deps: $(wildcard *.c *.h) %.o: %.c Makefile $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $< $(dso_filename): $(objects) - $(CC) $(dso_opts) -o $@ $(objects) -lcrypto + $(CC) $(dso_opts) -o $@ $(objects) $(LDFLAGS) -lcrypto + +osl_errors.h: errlist + sed -e 's/\([A-Z_]*\) .*/ E_OSL_\1/' \ + -e '1s/^/enum osl_errors {\n/1' \ + -e '$$!s/$$/,/g' \ + -e '$$s/$$/\n};/1' $< > $@ +errtab.h: errlist + sed -e 's/^\([A-Z_]*\)\s*\(.*\)/_S(E_OSL_\1, \2)/g' $< > $@ +osl.h: osl.h.in osl_errors.h + cat $^ > $@ clean: - rm -f *.o $(dso_filename) + rm -f *.o $(dso_filename) osl.h osl_errors.h errtab.h