Makefile 3.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#=======================================
# Configuration Section
#=======================================

#---------------------------------------
# Directories
#---------------------------------------

SRCDIR = $(shell pwd)
#
# 
#

# XXX autoconf
15 16 17


CUDD_INSTALL = $(HOME)/$(HOSTTYPE)
18 19

ifndef BIN_INSTALL_DIR 
20
  BIN_INSTALL_DIR := $(HOME)/$(HOSTTYPE)/bin
21 22 23
endif

ifndef INC_INSTALL_DIR 
24
  INC_INSTALL_DIR := $(HOME)/$(HOSTTYPE)/include
25 26 27
endif

ifndef LIB_INSTALL_DIR 
28
  LIB_INSTALL_DIR := $(HOME)/$(HOSTTYPE)/lib
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
endif


#---------------------------------------
# C part
#---------------------------------------

CC = gcc
ICFLAGS = \
	-I$(CUDD_INSTALL)/include \
	-Winline -Wimplicit-function-declaration \
	-Wall
#
# XCFLAGS should be the same than the one with which CUDD is compiled
#
44 45 46 47 48

# i386-linux
# XCFLAGS = -mcpu=pentiumpro -malign-double -DHAVE_IEEE_754 -DBSD

# sparc-sun
49
XCFLAGS = -mcpu=ultrasparc -DHAVE_IEEE_754 -DUNIX100
50

51
# Windows95/98/NT with Cygwin tools
52
# XCFLAGS	= -mcpu=pentiumpro -malign-double -DHAVE_IEEE_754 -DHAVE_GETRLIMIT=0 -DRLIMIT_DATA_DEFAULT=67108864
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
CFLAGS = $(ICFLAGS) $(XCFLAGS) -O3 -DNDEBUG
CFLAGS_DEBUG = $(ICFLAGS) $(XCFLAGS) -O1 -g -UNDEBUG
CFLAGS_PROF = $(ICFLAGS) $(XCFLAGS) -O3 -DNDEBUG -g -pg

#=======================================
# End of Configuration Section
#=======================================

#---------------------------------------
# Files
#---------------------------------------

CCMODULES = \
	cuddauxAddIte cuddauxBridge cuddauxCompose \
	cuddauxGenCof cuddauxMisc cuddauxTDGenCof 

CCSRC = cuddaux.h cuddauxInt.h $(CCMODULES:%=%.c)

CCLIB_TOINSTALL = libcuddaux.a libcuddaux_debug.a libcuddaux_prof.a
CCINC_TOINSTALL = cuddaux.h

#---------------------------------------
# Rules
#---------------------------------------

# Global rules
all: $(CCLIB_TOINSTALL)
debug: libcuddaux_debug.a
prof: libcuddaux_prof.a

install: all
	cp -f $(CCLIB_TOINSTALL) $(LIB_INSTALL_DIR)
	cp -f $(CCINC_TOINSTALL) $(INC_INSTALL_DIR)

distclean: mostlyclean
	(cd $(LIB_INSTALL_DIR); /bin/rm -f $(CCLIB_TOINSTALL))
	(cd $(INC_INSTALL_DIR); /bin/rm -f $(CCINC_TOINSTALL))

mostlyclean:	
	/bin/rm -f cuddaux.?? cuddaux.??? cuddaux.info
	/bin/rm -fr html

clean:
	/bin/rm -f *.[ao]

tar: $(CCSRC) Makefile README Changes cuddaux.texi texinfo.tex
	(cd ..; tar zcvf $(HOME)/cuddaux.tgz $(^:%=cuddaux/%))

dist: $(CCSRC) Makefile README Changes cuddaux.texi texinfo.tex cuddaux.dvi cuddaux.info html
	(cd ..; tar zcvf $(HOME)/cuddaux.tgz $(^:%=cuddaux/%))

# TEX rules
cuddaux.dvi: cuddaux.texi
	texi2dvi $<
cuddaux.ps: cuddaux.dvi
	dvips -o $@ $<
cuddaux.info: cuddaux.texi
	makeinfo --no-split $<
cuddaux.html: cuddaux.texi
	texi2html -split=chapter -nosec_nav -subdir=html $<

#--------------------------------------------------------------
# IMPLICIT RULES AND DEPENDENCIES
#--------------------------------------------------------------

.SUFFIXES: .c .h .o .a

#-----------------------------------
# C
#-----------------------------------

libcuddaux.a: $(CCMODULES:%=%.o)
	ar rcs libcuddaux.a $^
libcuddaux_debug.a: $(CCMODULES:%=%_debug.o)
	ar rcs $@ $^
libcuddaux_prof.a: $(CCMODULES:%=%_prof.o)
	ar rcs $@ $^

%.o: %.c cuddaux.h 
	$(CC) $(CFLAGS) -c -o $@ $<
%_debug.o: %.c cuddaux.h 
	$(CC) $(CFLAGS_DEBUG) -c -o $@ $<
%_prof.o: %.c cuddaux.h 
	$(CC) $(CFLAGS_PROF) -c -o $@ $<