forked from frkd-dev/yuvit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.linux
39 lines (27 loc) · 852 Bytes
/
Makefile.linux
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
APPNAME=yuvit
DESTDIR ?= /
INCDIR ?= $(DESTDIR)/usr/include
INSTALLDIR ?= $(DESTDIR)/usr/bin
SOURCES=$(wildcard *.cpp)
OBJECTS=$(patsubst %.cpp,%.o,$(SOURCES))
STATICLIB=$(APPNAME).a
LIBS = -lfreeimage -lstdc++
CPUS=$(shell cat /proc/cpuinfo | grep processor | wc -l)
CXX=g++
CXXFLAGS = -Wall -O3 -I FreeImage/Dist -L FreeImage/Dist
default : $(APPNAME)
%.o : %.cpp
@$(CXX) $(CXXFLAGS) -o $@ -c $<
$(STATICLIB) : $(OBJECTS)
@$(AR) rs $@ $(OBJECTS)
$(APPNAME): FreeImage $(STATICLIB)
@$(CXX) -o $@ $(STATICLIB) $(LIBS) $(CXXFLAGS)
FreeImage :
@$(MAKE) --jobs=$(CPUS) --directory=FreeImage -f Makefile.gnu
clean :
@$(MAKE) --directory=FreeImage -f Makefile.gnu clean
$(RM) $(OBJECTS) $(APPNAME) $(STATICLIB)
install :
install -d $(INSTALLDIR)
install -m 755 -o root -g root $(APPNAME) $(INSTALLDIR)
.PHONY : clean FreeImage install