diff --git a/Makefile b/Makefile index b1c2469..513e72c 100644 --- a/Makefile +++ b/Makefile @@ -450,7 +450,7 @@ lib/potion/buffile${LOADEXT}: core/config.h core/potion.h \ lib/buffile.${OPIC} lib/buffile.c lib/libpotion${DLL} @${ECHO} LD $@ @${LIBPNA_AWAY} - @${CC} $(DEBUGFLAGS) -o $@ ${LDDLLFLAGS} ${RPATH} \ + @${CC} $(DEBUGFLAGS) -o $@ $(subst libpotion,buffile,${LDDLLFLAGS}) ${RPATH} \ lib/buffile.${OPIC} ${LIBPTH} -lpotion ${LIBS} > /dev/null @${LIBPNA_BACK} diff --git a/config.mak b/config.mak index 0035072..05605ca 100644 --- a/config.mak +++ b/config.mak @@ -18,6 +18,8 @@ DEBUG ?= 0 WIN32 = 0 CLANG = 0 JIT = 0 +ICC = 0 +GCC = 0 EXE = APPLE = 0 CYGWIN = 0 @@ -147,6 +149,7 @@ ifneq ($(shell ./tools/config.sh "${CC}" icc),0) endif else ifneq ($(shell ./tools/config.sh "${CC}" gcc),0) + GCC = 1 WARNINGS += -Wno-switch -Wno-unused-label DEBUGFLAGS += --param ssp-buffer-size=1 ifeq (${DEBUG},0) @@ -177,8 +180,10 @@ endif CROSS = $(shell tools/config.sh "${CC}" cross) # cygwin is not WIN32. detect mingw target on cross +# maybe parse versions from core/potion.h ifeq ($(shell tools/config.sh "${CC}" mingw),1) WIN32 = 1 + LDFLAGS += -Wl,--major-image-version,0,--minor-image-version,1 LDDLLFLAGS = -shared EXE = .exe DLL = .dll @@ -214,6 +219,7 @@ ifeq ($(shell tools/config.sh "${CC}" mingw),1) else ifeq ($(shell tools/config.sh "${CC}" cygwin),1) CYGWIN = 1 + LDFLAGS += -Wl,--major-image-version,0,--minor-image-version,1 LDDLLFLAGS = -shared LOADEXT = .dll EXE = .exe @@ -224,7 +230,7 @@ ifeq ($(shell tools/config.sh "${CC}" apple),1) DLL = .dylib LOADEXT = .bundle LDDLLFLAGS = -dynamiclib -undefined dynamic_lookup -fpic -Wl,-flat_namespace - RDLLFLAGS = -install_name "@executable_path/../lib/libpotion${DLL}" + LDDLLFLAGS += -install_name "@executable_path/../lib/libpotion${DLL}" RPATH = RPATH_INSTALL = else @@ -327,7 +333,7 @@ core/config.h: config.inc core/version.h tools/config.sh config.mak @${CAT} core/version.h > core/config.h @${MAKE} -s -f config.mak config.h.echo >> core/config.h -#TODO: fix when git is not available +# TODO: fix when git is not available core/version.h: $(shell git show-ref HEAD | ${SED} "s,^.* ,.git/,g") @${ECHO} MAKE $@ @${ECHO} "/* created by ${MAKE} -f config.mak */" > core/version.h