forked from AugustoRuiz/Img2CPC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.cygwin
43 lines (33 loc) · 814 Bytes
/
Makefile.cygwin
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
INCDIR=include
SRCDIR=src
OBJDIR=obj
BINDIR=bin
LIBDIR=lib
CC=gcc
CXX=g++
CXXFLAGS=-std=c++11 -O3 -Werror -Wall -fsigned-char
LDLIBS=-L$(LIBDIR) -lfreeimage
vpath %.hpp $(INCDIR)
vpath %.cpp $(SRCDIR)
vpath %.cc $(SRCDIR)
vpath %.o $(OBJDIR)
HEADERS = $(wildcard $(INCDIR)/*)
SRCS = $(wildcard $(SRCDIR)/*.cc) $(wildcard $(SRCDIR)/*.cpp)
OBJS = $(patsubst $(SRCDIR)%,$(OBJDIR)%,$(patsubst %.cc,%.o,$(patsubst %.cpp,%.o,$(SRCS))))
APPNAME = $(BINDIR)/img2cpc
all: $(APPNAME)
$(APPNAME): $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
$(OBJDIR)/%.o: %.cc
$(CXX) $(CXXFLAGS) -o $@ -c -I$(INCDIR) $<
$(OBJDIR)/%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c -I$(INCDIR) $<
showVars:
$(info %.o)
$(info $(HEADERS))
$(info $(SRCS))
$(info $(OBJS))
clean:
$(RM) $(OBJDIR)/*
cleanall: clean
$(RM) $(BINDIR)/*