File: Makefile

package info (click to toggle)
guava 3.6-2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 11,788 kB
  • ctags: 2,359
  • sloc: ansic: 20,846; xml: 10,043; sh: 2,855; makefile: 388
file content (77 lines) | stat: -rw-r--r-- 3,254 bytes parent folder | download
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
77
CC      = gcc
CFLAGS  = -O2
SRCDIR  = ../../src/leon/src
CJSRCDIR= ../../src/ctjhai

GAP_PATH=../..
PKG_PATH=..
SRCDISTFILE=guava

all:
	( test -d bin || mkdir bin; \
	test -d bin/x86_64-unknown-linux-gnu-gcc || mkdir bin/x86_64-unknown-linux-gnu-gcc; cd bin/x86_64-unknown-linux-gnu-gcc; \
	$(MAKE) -f ../../Makefile all2 CC="$(CC)" CFLAGS="$(CFLAGS)"; \
	cd $(SRCDIR)/../; ./configure; $(MAKE); mkdir ../../bin/leon; \
	cp cent ../../bin/leon; cp cjrndper ../../bin/leon; \
	cp commut ../../bin/leon; cp compgrp ../../bin/leon; \
	cp desauto ../../bin/leon; cp fndelt ../../bin/leon; \
	cp generate ../../bin/leon; cp inter ../../bin/leon; \
	cp orbdes ../../bin/leon; cp orblist ../../bin/leon; \
	cp randobj ../../bin/leon; cp setstab ../../bin/leon; \
	cp wtdist ../../bin/leon; cp src/*.sh ../../bin/leon; \
	cp wtdist ../../bin; cp desauto ../../bin; \
	cp wtdist ../../bin/x86_64-unknown-linux-gnu-gcc; cp desauto ../../bin/x86_64-unknown-linux-gnu-gcc \
	)
# the last two for backwards compatibility?

all2:	  leonconv minimum-weight

# rules to make the executables, just link them together
leonconv: leonconv.o
	$(CC) $(CFLAGS) -o leonconv leonconv.o

minimum-weight: minimum-weight.o minimum-weight-gf2.o minimum-weight-gf3.o popcount.o
	$(CC) -lm -o minimum-weight \
		minimum-weight.o minimum-weight-gf2.o minimum-weight-gf3.o popcount.o
	
# rules to make the .o files, just compile the .c file
# cannot use implicit rule, because .c files are in a different directory
leonconv.o: ../../src/leonconv.c
	$(CC) -c $(CFLAGS) -o leonconv.o -c ../../src/leonconv.c

minimum-weight.o: $(CJSRCDIR)/minimum-weight.c $(CJSRCDIR)/minimum-weight-gf2.h $(CJSRCDIR)/minimum-weight-gf3.h $(CJSRCDIR)/popcount.h $(CJSRCDIR)/config.h $(CJSRCDIR)/types.h
	$(CC) -c -O3 -Wall -I $(CJSRCDIR) $(CJSRCDIR)/minimum-weight.c
minimum-weight-gf2.o: $(CJSRCDIR)/minimum-weight-gf2.c $(CJSRCDIR)/minimum-weight-gf2.h $(CJSRCDIR)/popcount.h $(CJSRCDIR)/config.h $(CJSRCDIR)/types.h
	$(CC) -c -O3 -Wall -I $(CJSRCDIR) $(CJSRCDIR)/minimum-weight-gf2.c
minimum-weight-gf3.o: $(CJSRCDIR)/minimum-weight-gf3.c $(CJSRCDIR)/minimum-weight-gf3.h $(CJSRCDIR)/popcount.h $(CJSRCDIR)/config.h $(CJSRCDIR)/types.h
	$(CC) -c -O3 -Wall -I $(CJSRCDIR) $(CJSRCDIR)/minimum-weight-gf3.c
popcount.o: $(CJSRCDIR)/popcount.c $(CJSRCDIR)/popcount.h $(CJSRCDIR)/config.h $(CJSRCDIR)/types.h
	$(CC) -c -O3 -Wall -I $(CJSRCDIR) $(CJSRCDIR)/popcount.c

# pseudo targets
clean:
	( cd bin/x86_64-unknown-linux-gnu-gcc; rm -f *.o )
	( cd src && make clean )
	( cd src/leon && make clean )

distclean: clean
	( rm -rf bin )
	( rm -f Makefile )
	( cd src && make distclean )
	( cd src/leon && make distclean )

# for GAP distribution
src_dist:
	@(cmp ${PKG_PATH}/guava/doc/guava.tex \
         ${GAP_PATH}/doc/guava.tex \
         || echo \
         "*** WARNING: current 'guava.tex' and 'doc/guava.tex' differ ***")
	@zoo ah ${SRCDISTFILE}.zoo \
                ${PKG_PATH}/guava/Makefile \
                ${PKG_PATH}/guava/doc/guava.tex \
                ${PKG_PATH}/guava/init.g \
                `find ${PKG_PATH}/guava/lib -name "*.g" -print` \
                `find ${PKG_PATH}/guava/tbl -name "*.g" -print` \
                `find ${PKG_PATH}/guava/src -print`
	@zoo PE ${SRCDISTFILE}.zoo