All pastes #1178549 Raw Edit

Mine

public text v1 · immutable
#1178549 ·published 2008-08-19 10:55 UTC
rendered paste body
# $Id: Makefile,v 1.26 2008/08/18 15:08:39 eric Exp $
# SWObjects build rules -- see http://www.w3.org/2008/04/SPARQLfed/

# recipies:
#   normal build:
#     make SPARQLfed
#   force the use of the tracing facilities (and redirect to stdout):
#     make -W sample_RuleMap1.cc test
#   have valgrind start a debugger (works as M-x gdb invocation command):
#     valgrind --db-attach=yes --leak-check=yes sample_RuleMap1 query_HealthCare1.rq ruleMap_HealthCare1.rq
#   same, if you aren't working in gdb:
#     make valgrind
#   debugging in emacs:
#     gdb --annotate=3 sample_RuleMap1    (set args query_HealthCare1.rq ruleMap_HealthCare1.rq)

# BUGS:
#   .hh dependency probs -- use .deps?

%.d : %.ll 
	touch $@	
	makedepend -f $@ $^ $(DEFS) $(INC)

%.d : %.yy
	touch $@	
	makedepend -f $@ $^ $(DEFS) $(INC) 

%.d :  %.cc  
	touch $@	
	makedepend -f $@ $^ $(DEFS) $(INC) 

%.d :  %.hh 
	touch $@	
	makedepend -f $@ $^ $(DEFS) $(INC) 

#VERY hackish
%.hh : %.yy
	$(BISON) -o $(subst .hh,.cc,$@) $< 

%.cc : %.yy
	$(BISON) -o $@ $< 

%.cc : %.ll
	$(FLEX) -o $@  $< 

FLEX=flex
BISON=bison
#YACC=bison

#LIBS
DEBUG=-g
OPT=-O4
DEFS=-DYYTEXT_POINTER=1
WARN=-W -Wall -Wextra 
TOONOISEY=-ansi
CFLAGS := $(DEFS) $(OPT) $(DEBUG) $(WARN) -pipe 
CXXFLAGS := $(CFLAGS) 

LD = $(CXX)
LDFLAGS = $(LIBINC) 
VER=0.1

#some progressive macports 
#CC=llvm-gcc
#CXX=llvm-g++
#LLVMCFLAGS = ` llvm-config --cflags` -O4 
#LLVMCXXFLAGS = ` llvm-config --cxxflags` -O4
#LLVMLDFLAGS = ` llvm-config --ldflags --libs `
#LLVMLIBS= ` llvm-config --libs`
# ... you get the idea...
#CFLAGS += $(LLVMCFLAGS)   

#just for a sample 
LIBINC=-L/opt/local/lib -lm



# Core objects


# yacc parsers


## SPARQLfed

## TurtleS


# Libraries
    
BISONOBJ =  $(subst .yy,.o,$(wildcard *.yy))
FLEXOBJ=  $(subst .ll,.o,$(wildcard *.ll))
LIBOBJ = $(BISONOBJ) $(FLEXOBJ) $(subst .cc,.o,$(wildcard *.cc))

LIBSW = libSWObjects.a

LIBS=$(LIBSW)

$(LIBSW): $(LIBOBJ)
	$(AR) rcvs $@  $^
# Sample apps
#   sample_TopicN - sample app number N for a given topic.
#   Vsample_TopicN - valgrind test of the this sample
## RuleMap1 - convert a SPARQL query on an interface graph to one that
##            works on a privage graph
SAMPLES=sample_RuleMap1 Vsample_RuleMap1

sample_RuleMap1: sample_RuleMap1.o $(LIBS)
	$(LD) $(LDFLAGS) -o $@  $^
	  
$(TEST_SEQ): sample_RuleMap1 query_HealthCare1.rq ruleMap_HealthCare1.rq

Vsample_RuleMap1: $(TESTSEQ)
	valgrind --leak-check=yes --xml=no $^ 

# Tests
#   test: includes all samples
#   valgrind: valgrinds all samples

test: $(TEST_SEQ)
	$^

valgrind: Vsample_RuleMap1

# Distributions

dist: $(LIBS)
	$(RM) -f SWObjects_$(VER).tar.gz README.html
	lynx -dump -source http://www.w3.org/2008/04/SPARQLfed/ | perl -pe 's{href="\.\./\.\./\.\.}{href="http://www.w3.org}g;s{href="\.\./\.\.}{href="http://www.w3.org/2008}g'> README.html
	$(ECHO) "Generating the inclusion from the manifest (HEADER.html)"
	$(PERL) -ne 'print join("\n", "README.html", m/href="([a-zA-Z]{2}[a-zA-Z0-9._]+)"/g, undef)' HEADER.html | xargs tar czf SWObjects_$(VER).tar.gz --transform s,,SWObjects_$(VER)/,1
	$(RM) README.html

# Clean - rm everything we remember to rm.


clean:
	$(RM) *.o *.d *.d.bak  \
        $(BISON_BOOTSTRAP) \
        $(subst .ll,.cc,$(wildcard *.ll))  \
        $(subst .yy,.cc,$(wildcard *.yy)) \
        $(subst .yy,.hh,$(wildcard *.yy)) \
        $(LIBS) $(SAMPLES)

.PHONY: test dist all

all: depend test dist

depend: Makefile  $(subst .o,.d,$(LIBOBJ))


include $(wildcard $(subst .o,.d,$(LIBOBJ)))