X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=Makefile;h=6350b8eccba228c2185f267c5b1158df6b6bc9ea;hp=e79390c4ddad37f9d93c624f84c2ecc1984e98c3;hb=903c582ebba832333f869a2803fe84e23edc0980;hpb=5952112a37ecdaedf3b76e08f97d307f1056c512 diff --git a/Makefile b/Makefile index e79390c..6350b8e 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 @@ -33,11 +33,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 +48,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 +58,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