Skip to content

Commit

Permalink
Updated gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapages committed Jan 25, 2016
1 parent c36c39f commit 3872094
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Compiled files
*.o
multitex
obj/*
bin/*

# tmp files
*~
Expand Down
42 changes: 33 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
OBJECTS = camera.o main.o mesh2d.o mesh3d.o \
multitexturer.o triangle.o color.o \
image.o chart.o unwrapper.o packer.o
# ------------------------------------------------
# Makefile
#
# Date : 2015-01-24
# Author: Rafa Pagés + Daniel Berjón, but basically thanks to the following link:
# http://stackoverflow.com/questions/7004702/how-can-i-create-a-makefile-for-c-projects-with-src-obj-and-bin-subdirectories
# ------------------------------------------------

TARGET = multitex

all: multitex
CXX = g++
CFLAGS = -std=c++11 -Wall -I.

LINKER = g++ -o
LFLAGS = -Wall -I. -lm
LIBS = -lfreeimageplus -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_objdetect -lopencv_photo
CXXFLAGS = -Wall -pedantic -std=c++98

SRCDIR = src
OBJDIR = obj
BINDIR = bin

multitex: $(OBJECTS)
g++ $(CXXFLAGS) -o multitex $(OBJECTS) $(LIBS)
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
INCLUDES := $(wildcard $(SRCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
rm = rm -f


$(BINDIR)/$(TARGET): $(OBJECTS)
@mkdir -p $(BINDIR)
$(LINKER) $@ $(LFLAGS) $(OBJECTS) $(LIBS)
@echo "Linking complete!"

$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.cpp
@mkdir -p $(OBJDIR)
$(CXX) $(CFLAGS) -c $< -o $@
@echo "Compiled "$<" successfully!"

clean:
rm -f *.o
rm -f multitex
$(rm) $(OBJECTS)
$(rm) $(BINDIR)/$(TARGET)
@echo "Cleanup complete!"

0 comments on commit 3872094

Please sign in to comment.