Skip to content

Instantly share code, notes, and snippets.

@bardware
Created January 20, 2015 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bardware/357b0823237a9d1defe8 to your computer and use it in GitHub Desktop.
Save bardware/357b0823237a9d1defe8 to your computer and use it in GitHub Desktop.
dlltool as variable to allow cross compilation
Index: Dll/Makefile.mingw32
===================================================================
RCS file: /cvsroot/lame/lame/Dll/Makefile.mingw32,v
retrieving revision 1.3
diff -u -r1.3 Makefile.mingw32
--- Dll/Makefile.mingw32 7 Feb 2009 11:18:46 -0000 1.3
+++ Dll/Makefile.mingw32 20 Jan 2015 20:42:12 -0000
@@ -15,7 +15,8 @@
CFLAGS = -I$(LAME_SRC_ROOT)/include -I$(LAME_SRC_ROOT)/libmp3lame
CC = g++
LD = g++
-LFLAGS = -L$(LAME_SRC_ROOT)/libmp3lame -o $(DLL_NAME).dll -mdll -s
+DLLTOOL = dlltool
+LFLAGS = -L$(LAME_SRC_ROOT)/libmp3lame/.libs -o $(DLL_NAME).dll -mdll -s
LIBS = -lmp3lame
all: $(DLL_NAME).dll example.exe
@@ -27,7 +28,7 @@
$(LD) $(LFLAGS) $(OFILES) $(LIBS)
$(DLL_NAME)_exp.o : BladeMP3EncDLL.o
- dlltool --input-def BladeMP3EncDLL.def --output-lib lib$(DLL_NAME).a --output-exp $(DLL_NAME)_exp.o --dllname $(DLL_NAME) BladeMP3EncDLL.o
+ $(DLLTOOL) --input-def BladeMP3EncDLL.def --output-lib lib$(DLL_NAME).a --output-exp $(DLL_NAME)_exp.o --dllname $(DLL_NAME) BladeMP3EncDLL.o
%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
@bardware
Copy link
Author

make -f Makefile.mingw32 CC=x86_64-w64-mingw32-g++ LD=x86_64-w64-mingw32-g++ DLLTOOL=x86_64-w64-mingw32-dlltool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment