From eb0ded8d555c16a0d304232603811b9a39038a8c Mon Sep 17 00:00:00 2001 From: Stefan Gehn Date: Fri, 18 Apr 2014 09:23:07 +0200 Subject: [PATCH] Use binary extension during gkrellm build Honor the BINEXT variable in the gkrellm and gkrellmd target to enforce building with the correct extension. This is needed for recent mingw-w64 cross toolchains since those do not automatically append ".exe" when linking. --- server/Makefile | 9 +++++---- src/Makefile | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/server/Makefile b/server/Makefile index 90083a2..d1d4385 100644 --- a/server/Makefile +++ b/server/Makefile @@ -113,10 +113,10 @@ OS_RELEASE=$(shell uname -r) OBJS = main.o monitor.o mail.o plugins.o glib.o utils.o sysdeps-unix.o log.o -all: gkrellmd +all: gkrellmd$(BINEXT) -gkrellmd: $(OBJS) $(EXTRAOBJS) - $(CC) $(OBJS) $(EXTRAOBJS) -o gkrellmd \ +gkrellmd$(BINEXT): $(OBJS) $(EXTRAOBJS) + $(CC) $(OBJS) $(EXTRAOBJS) -o $@ \ $(LDFLAGS) $(LIBS) $(LINK_FLAGS) static: $(OBJS) $(EXTRAOBJS) @@ -170,11 +170,12 @@ endif windows: libgkrellmd.a $(MAKE) \ + BINEXT=".exe" \ CFLAGS="${CFLAGS} -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN" \ LINK_FLAGS="${LINK_FLAGS} -mconsole" \ EXTRAOBJS="${EXTRAOBJS} win32-resource.o win32-plugin.o" \ SYS_LIBS="-lws2_32 -lwtsapi32 -lpdh -lnetapi32 -liphlpapi -lintl" \ - gkrellmd + all install: install_bin install_inc install_man diff --git a/src/Makefile b/src/Makefile index b04456e..08deabd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -114,10 +114,10 @@ OBJS = main.o alerts.o battery.o base64.o clock.o cpu.o disk.o fs.o \ UNIXOBJS = winops-x11.o -all: gkrellm +all: gkrellm$(BINEXT) -gkrellm: check_env $(OBJS) $(UNIXOBJS) $(EXTRAOBJS) - $(CC) $(OBJS) $(UNIXOBJS) $(EXTRAOBJS) -o gkrellm \ +gkrellm$(BINEXT): check_env $(OBJS) $(UNIXOBJS) $(EXTRAOBJS) + $(CC) $(OBJS) $(UNIXOBJS) $(EXTRAOBJS) -o $@ \ $(LDFLAGS) $(LIBS) $(LINK_FLAGS) static: check_env $(OBJS) $(UNIXOBJS) $(EXTRAOBJS) @@ -190,13 +190,14 @@ solaris: windows: libgkrellm.a $(MAKE) \ + BINEXT=".exe" \ CFLAGS="${CFLAGS} -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN" \ LINK_FLAGS="${LINK_FLAGS} -mwindows" \ EXTRAOBJS="${EXTRAOBJS} winops-win32.o win32-plugin.o win32-resource.o" \ SYS_LIBS="-lws2_32 -lwtsapi32 -lpdh -lnetapi32 -liphlpapi -lintl" \ X11_LIBS="" \ UNIXOBJS="" \ - gkrellm + all install: install_bin install_inc install_man