Skip to content

Instantly share code, notes, and snippets.

@Madsy
Created September 22, 2009 22:37
Show Gist options
  • Save Madsy/191509 to your computer and use it in GitHub Desktop.
Save Madsy/191509 to your computer and use it in GitHub Desktop.
CXX = g++
CXXFLAGS = -c -O3 -fomit-frame-pointer -Wall -Wextra `pkg-config --cflags libxml++-2.6`
LDFLAGS = -lpthread -lpng -lz `pkg-config --libs libxml++-2.6`
OBJDIR = build
OBJS = $(OBJDIR)/main.o $(OBJDIR)/image.o $(OBJDIR)/primitives.o $(OBJDIR)/xmlconfig.o
.PHONY : all
.PHONY : dirtest
all: \
dirtest \
rt \
dirtest:
mkdir -p $(OBJDIR)
rt : $(OBJS)
g++ -o rt $^ $(LDFLAGS)
$(OBJDIR)/main.o : main.cpp
g++ -o $@ $(CXXFLAGS) $^
$(OBJDIR)/image.o : image.cpp
g++ -o $@ $(CXXFLAGS) $^
$(OBJDIR)/primitives.o : primitives.cpp
g++ -o $@ $(CXXFLAGS) $^
$(OBJDIR)/xmlconfig.o : xmlconfig.cpp
g++ -o $@ $(CXXFLAGS) $^
.PHONY : clean
clean:
rm -rf $(OBJDIR) && rm -f rt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment