-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (51 loc) · 1.75 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File : Makefile
# RCS : $Id: Makefile,v 1.23 2004/04/02 14:04:36 schachte Exp $
# Author : Peter Schachte
# Origin : 1995
# Purpose : build ROBDD manipulation code to support groundness analyzer
include Makefile.SWI
# The command to run SWI Prolog
SWIPL=swipl
SOLIBS=-L $(SWIDIR)/lib/x86_64-darwin16.4.0 -lswipl
SOOS=swi_robdd.o swi_bryant.o swi_bryantPrint.o
OS=bryant.o bryantPrint.o
SO=swi_robdd.$(SHAREDEXT)
RELFILES=bryant.c bryant.h bryantPrint.c var.h Makefile
GENFILES=$(TESTOS) $(OS) $(SOOS)
RM=rm -f
MV=mv
MKDIR=mkdir -p
DEBUG=-g -DDEBUGALL
OPTIMIZE=-O3 -DNDEBUG -funroll-loops
CC=gcc
BASECFLAGS = -Wall -Wshadow -Wcast-qual -Wcast-align -Wpointer-arith \
-Wstrict-prototypes -Wmissing-declarations -Winline \
-pedantic
LIBS=
SOOPTS=-fpic -fPIC -DSWI
# General options
CHOSENOPTIM=$(OPTIMIZE)
#CHOSENOPTIM=$(DEBUG)
OPTS=-DCLEAR_CACHES -DCOMPUTED_TABLE -DEQUAL_TEST
# Main makefile
CFLAGS=$(BASECFLAGS) $(CHOSENOPTIM) $(OPTS) $(RSET) $(MSGS) $(EXTRAOPTS)
all: $(OS) $(SO)
so: $(SO)
bryantPrint.o: bryantPrint.c bryant.h
bryant.o: bryant.c bryant.h
swi_robdd.o: swi_robdd.c bryant.h
$(CC) -c -I $(SWIDIR)/include $(SOOPTS) -o $@ swi_robdd.c
swi_bryantPrint.o: bryantPrint.c bryant.h
$(CC) -c -I $(SWIDIR)/include $(SOOPTS) -o $@ bryantPrint.c
swi_bryant.o: bryant.c bryant.h
$(CC) -c -I $(SWIDIR)/include $(SOOPTS) -o $@ bryant.c
Makefile.SWI:
$(SWIPL) -q -g 'file_search_path(swi,Dir), current_prolog_flag(shared_object_extension,So), format("SWIDIR=~w~n", [Dir]), format("SHAREDEXT=~w~n", [So]), halt.' > $@
$(SO): $(SOOS)
gcc -shared -o $@ $(CFLAGS) $(SOOPTS) $(SOLIBS) $(SOOS)
$(SOOS): bryant.h
clean:
- $(RM) $(GENFILES) Makefile.SWI
tidy: clean
- $(RM) $(TESTS) $(SO)
- $(RM) *~