• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
12DLL_NAME = lame_enc
13LAME_SRC_ROOT = ..
14OFILES = BladeMP3EncDLL.o $(DLL_NAME)_exp.o
15CFLAGS = -I$(LAME_SRC_ROOT)/include -I$(LAME_SRC_ROOT)/libmp3lame
16CC = g++
17LD = g++
18DLLTOOL = dlltool
19LFLAGS = -L$(LAME_SRC_ROOT)/libmp3lame/.libs -o $(DLL_NAME).dll -mdll -s
20LIBS = -lmp3lame
21
22all: $(DLL_NAME).dll example.exe
23
24BladeMP3EncDLL.o: BladeMP3EncDLL.c BladeMP3EncDLL.h ../include/lame.h \
25 ../libmp3lame/lame_global_flags.h ../libmp3lame/version.h
26
27$(DLL_NAME).dll : $(OFILES)
28	$(LD) $(LFLAGS) $(OFILES) $(LIBS)
29
30$(DLL_NAME)_exp.o : BladeMP3EncDLL.o
31	$(DLLTOOL) --input-def BladeMP3EncDLL.def --output-lib lib$(DLL_NAME).a --output-exp $(DLL_NAME)_exp.o --dllname $(DLL_NAME) BladeMP3EncDLL.o
32
33%.o : %.c
34	$(CC) $(CFLAGS) -c $< -o $@
35
36example.exe : Example.cpp BladeMP3EncDLL.h
37	$(CC) Example.cpp -o example.exe
38
39clean :
40	rm -f $(DLL_NAME).dll $(OFILES) example.exe
41