forked from frkd-dev/yuvit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.osx
46 lines (35 loc) · 1.22 KB
/
Makefile.osx
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
38
39
40
41
42
43
44
45
46
include Common.mk
SOURCES = $(wildcard *.cpp)
OBJDIR_32 = _osx/32
OBJDIR_64 = _osx/64
OBJS = $(SOURCES:.cpp=.o)
OBJS_32 = $(addprefix $(OBJDIR_32)/, $(OBJS))
OBJS_64 = $(addprefix $(OBJDIR_64)/, $(OBJS))
LINKLIBS = -lstdc++
CPUS=$(shell sysctl -n hw.ncpu)
CXX=g++
ARCH_32 = -arch i386
ARCH_64 = -arch x86_64
CXXFLAGS = -Wall -Os -I FreeImage/Dist -DAPPVERSION=\"$(APPVERSION)\"
CXXFLAGS_32 = $(ARCH_32) $(CXXFLAGS)
CXXFLAGS_64 = $(ARCH_64) $(CXXFLAGS)
default: dirs $(APPNAME)
$(OBJDIR_32)/%.o: %.cpp
@$(CXX) $(CXXFLAGS_32) -o $@ -c $<
$(OBJDIR_64)/%.o: %.cpp
@$(CXX) $(CXXFLAGS_64) -o $@ -c $<
$(APPNAME): FreeImage $(OBJS_32) $(OBJS_64)
@$(CXX) -o $(OBJDIR_32)/$@ $(ARCH_32) $(OBJS_32) FreeImage/Dist/libfreeimage.a $(LINKLIBS)
@$(CXX) -o $(OBJDIR_64)/$@ $(ARCH_64) $(OBJS_64) FreeImage/Dist/libfreeimage.a $(LINKLIBS)
dirs:
@mkdir -p $(OBJDIR_32)
@mkdir -p $(OBJDIR_64)
FreeImage:
@make --jobs=$(CPUS) --directory=FreeImage -f Makefile.osx
clean:
@make --directory=FreeImage -f Makefile.osx clean
@rm -rf $(OBJDIR_32) $(OBJDIR_64)
package: default
@zip -j $(APPNAME)_$(APPVERSION)_macosx_i386.zip $(OBJDIR_32)/$(APPNAME)
@zip -j $(APPNAME)_$(APPVERSION)_macosx_x86_64.zip $(OBJDIR_64)/$(APPNAME)
.PHONY: clean FreeImage dirs