Makefile.mingw32 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # This makefile compiles lame_enc.dll with mingw32 (and possibly cygwin)
  2. # Of course, you must first build ../libmp3lame/libmp3lame.a.
  3. # liblame_enc.a can be used to link the lame_enc.dll to your programs.
  4. # Tested with EAC 0.9pb9 (my own favorite, http://www.exactaudiocopy.de/)
  5. # example.exe compiles and works, too.
  6. # Vladislav Naumov, <vnaum@inbox.ru>
  7. #
  8. # PS: to 'make clean' you need rm. MS's del is unusable.
  9. # PPS: quick build:
  10. # make -fMakefile.mingw32
  11. DLL_NAME = lame_enc
  12. LAME_SRC_ROOT = ..
  13. OFILES = BladeMP3EncDLL.o $(DLL_NAME)_exp.o
  14. CFLAGS = -I$(LAME_SRC_ROOT)/include -I$(LAME_SRC_ROOT)/libmp3lame
  15. CC = g++
  16. LD = g++
  17. DLLTOOL = dlltool
  18. LFLAGS = -L$(LAME_SRC_ROOT)/libmp3lame/.libs -o $(DLL_NAME).dll -mdll -s
  19. LIBS = -lmp3lame
  20. all: $(DLL_NAME).dll example.exe
  21. BladeMP3EncDLL.o: BladeMP3EncDLL.c BladeMP3EncDLL.h ../include/lame.h \
  22. ../libmp3lame/lame_global_flags.h ../libmp3lame/version.h
  23. $(DLL_NAME).dll : $(OFILES)
  24. $(LD) $(LFLAGS) $(OFILES) $(LIBS)
  25. $(DLL_NAME)_exp.o : BladeMP3EncDLL.o
  26. $(DLLTOOL) --input-def BladeMP3EncDLL.def --output-lib lib$(DLL_NAME).a --output-exp $(DLL_NAME)_exp.o --dllname $(DLL_NAME) BladeMP3EncDLL.o
  27. %.o : %.c
  28. $(CC) $(CFLAGS) -c $< -o $@
  29. example.exe : Example.cpp BladeMP3EncDLL.h
  30. $(CC) Example.cpp -o example.exe
  31. clean :
  32. rm -f $(DLL_NAME).dll $(OFILES) example.exe