forked from frkd-dev/yuvit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.mingw
37 lines (27 loc) · 1.09 KB
/
Makefile.mingw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
APPNAME=yuvit.exe
SOURCES=$(wildcard *.cpp)
OBJECTS=$(patsubst %.cpp,%.o,$(SOURCES))
STATICLIB=$(APPNAME).a
LIBS = -lfreeimage -lstdc++ -lwsock32 -lws2_32
INSTALLDIR=win32
CXX=g++
CXXFLAGS = -Wall -O3 -I FreeImage/Dist -L FreeImage/Dist
default : $(APPNAME)
%.o : %.cpp
@$(CXX) $(CXXFLAGS) -o $@ -c $<
dirs:
@if [[ ! -d $(INSTALLDIR) ]]; then mkdir $(INSTALLDIR); fi
$(STATICLIB) : $(OBJECTS)
@$(AR) rs $@ $(OBJECTS)
$(APPNAME): FreeImage $(STATICLIB) dirs
@$(CXX) -o $@ $(STATICLIB) $(LIBS) $(CXXFLAGS)
mv $(APPNAME) $(INSTALLDIR)/
# FreeImage's Makefile.mingw is intended for "compile under MinGW, use under MSVC", but we
# need "compile under Mingw, use under Mingw", so we use Makefile.cygwin with some overrides
FreeImage:
@$(MAKE) --jobs=$(NUMBER_OF_PROCESSORS) --directory=FreeImage -f Makefile.cygwin COMPILERFLAGS='-O3 -DNO_LCMS -DFREEIMAGE_LIB -D"__declspec(_a_)="' LIBRARIES="-lstdc++ -lwsock32 -lws2_32"
@$(RM) FreeImage/Dist/*.dll FreeImage/Dist/*.dll.a
clean :
@$(MAKE) --directory=FreeImage -f Makefile.cygwin clean
@$(RM) $(OBJECTS) $(APPNAME) $(STATLIB)
.PHONY : clean FreeImage