File: Makefile.examples

package info (click to toggle)
gecode 6.2.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,380 kB
  • sloc: cpp: 337,599; perl: 2,048; makefile: 1,798; sh: 215
file content (21 lines) | stat: -rw-r--r-- 709 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CXXFLAGS=-O3 -fPIC `pkg-config Qt5Widgets --cflags`
LDFLAGS=-lgecodedriver -lgecodesupport -lgecodekernel -lgecodesearch -lgecodeint -lgecodeminimodel -lgecodegist -lgecodeset -lgecodefloat -lpthread `pkg-config Qt5Widgets --libs`
EXAMPLES=$(patsubst %.cpp,%,$(wildcard *.cpp)) $(patsubst %.cpp.gz,%,$(wildcard *.cpp.gz))

all: $(EXAMPLES)

examples/scowl.hpp examples/sudoku-instances.hh $(addsuffix .cpp,$(EXAMPLES)):
	gunzip $@.gz

$(addsuffix .o,$(EXAMPLES)): $(addsuffix .cpp,$(EXAMPLES)) examples/scowl.hpp examples/sudoku-instances.hh
	g++ $(CXXFLAGS) $(patsubst %.o,%.cpp,$@) -c

clean:
	rm -f $(EXAMPLES)
	rm -f *.o

.PHONY: all clean

.SECONDEXPANSION:
$(EXAMPLES): $$@.o
	g++ $@.o -o $@ $(LDFLAGS)