Skip to content

Instantly share code, notes, and snippets.

@fepa
Created March 24, 2012 19:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fepa/2187179 to your computer and use it in GitHub Desktop.
Save fepa/2187179 to your computer and use it in GitHub Desktop.
A makefile for gecode projects (created this for the ID2204 course at KTH)
# Configure this makefile if needed then run
# $ make all
# to compile and link
# What files to compile
OBJS=money.cpp
# What file to compile to
MAINFILE=money
# What compiler to use
CC=g++
# Where is your gecode library?
# (Gecode's default 'make install' behavior installs gecode libraries and headers under /usr/local)
GECODEDIR=/usr/local
# 'make all' does both compiling and link (i.e 'make compile link')
all: compile link
# 'make compile' compiles files
compile: $(OBJS)
$(CC) -I$(GECODEDIR)/include -c $(OBJS)
# 'make link' links compiled files
link: $(OBJS)
$(CC) -o $(MAINFILE) -L$(GECODEDIR)/lib $(MAINFILE).o \
-lgecodeflatzinc -lgecodedriver -lgecodegist \
-lgecodesearch -lgecodeminimodel -lgecodeset \
-lgecodeint -lgecodekernel -lgecodesupport \
# 'make clean' cleans up generated files from make commands
clean:
rm -rf *o $(MAINFILE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment