| 1 |
# -*- Mode: Makefile; indent-tabs-mode: nil -*- |
| 2 |
# vim: set filetype=makefile tabstop=8 shiftwidth=4 expandtab: |
| 3 |
|
| 4 |
# |
| 5 |
# Makefile for ECL core library |
| 6 |
# |
| 7 |
top_srcdir= @top_srcdir@ |
| 8 |
srcdir = @srcdir@ |
| 9 |
VPATH = @srcdir@ |
| 10 |
|
| 11 |
# Programs used by "make": |
| 12 |
# |
| 13 |
CC = @CC@ |
| 14 |
TRUE_CC = $(CC) |
| 15 |
CFLAGS = -Wall -Wno-missing-braces -I. -I@true_builddir@ -I$(srcdir) \ |
| 16 |
-I../ecl/ -DECL_BUILD -DECL_API -DECL_NO_LEGACY @CPPFLAGS@ @CFLAGS@ \ |
| 17 |
@ECL_CFLAGS@ -c |
| 18 |
|
| 19 |
# The following flags could be added and used by GCC |
| 20 |
# -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align \ |
| 21 |
# -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-prototypes \ |
| 22 |
# -Wredundant-decls -Wunreachable-code -Winline |
| 23 |
|
| 24 |
SHELL = /bin/sh |
| 25 |
RM = @RM@ |
| 26 |
EXE = @EXEEXT@ |
| 27 |
DPP = ./dpp$(EXE) |
| 28 |
RANLIB = @RANLIB@ |
| 29 |
AR = @AR@ |
| 30 |
|
| 31 |
# Data for installation |
| 32 |
# |
| 33 |
INSTALL = @INSTALL@ |
| 34 |
INSTALL_DATA = @INSTALL_DATA@ |
| 35 |
prefix=@prefix@ |
| 36 |
exec_prefix=@exec_prefix@ |
| 37 |
libdir=@libdir@ |
| 38 |
includedir=@includedir@ |
| 39 |
|
| 40 |
# Files |
| 41 |
|
| 42 |
HDIR = ../ecl |
| 43 |
|
| 44 |
HFILES = $(HDIR)/config.h $(HDIR)/ecl.h $(HDIR)/ecl-cmp.h $(HDIR)/object.h \ |
| 45 |
$(HDIR)/cs.h $(HDIR)/stacks.h $(HDIR)/external.h $(HDIR)/cons.h \ |
| 46 |
$(HDIR)/legacy.h $(HDIR)/number.h $(HDIR)/page.h $(HDIR)/bytecodes.h \ |
| 47 |
$(HDIR)/cache.h $(HDIR)/config-internal.h $(HDIR)/ecl_atomics.h \ |
| 48 |
$(HDIR)/ecl-inl.h $(HDIR)/internal.h $(HDIR)/stack-resize.h \ |
| 49 |
$(HDIR)/threads.h $(HDIR)/impl/math_dispatch2.h \ |
| 50 |
$(HDIR)/impl/math_dispatch.h $(HDIR)/impl/math_fenv.h \ |
| 51 |
$(HDIR)/impl/math_fenv_msvc.h $(HDIR)/nucleus.h |
| 52 |
|
| 53 |
BOOT_OBJS = |
| 54 |
|
| 55 |
CLOS_OBJS = clos/cache.o clos/accessor.o clos/instance.o clos/gfun.o |
| 56 |
|
| 57 |
NUM_OBJS = number.o num_pred.o num_arith.o num_co.o num_log.o num_rand.o \ |
| 58 |
numbers/cos.o numbers/sin.o numbers/tan.o numbers/atan.o \ |
| 59 |
numbers/cosh.o numbers/sinh.o numbers/tanh.o numbers/exp.o \ |
| 60 |
numbers/expt.o numbers/log.o numbers/sqrt.o numbers/abs.o \ |
| 61 |
numbers/zerop.o numbers/plusp.o numbers/minusp.o numbers/negate.o \ |
| 62 |
numbers/conjugate.o numbers/one_plus.o numbers/one_minus.o \ |
| 63 |
numbers/plus.o numbers/minus.o numbers/times.o numbers/divide.o \ |
| 64 |
numbers/number_compare.o numbers/number_equalp.o numbers/minmax.o \ |
| 65 |
numbers/floor.o numbers/ceiling.o numbers/round.o numbers/truncate.o |
| 66 |
|
| 67 |
WRITER_OBJS = print.o printer/float_to_digits.o printer/float_to_string.o \ |
| 68 |
printer/integer_to_string.o printer/write_ugly.o \ |
| 69 |
printer/write_object.o printer/write_symbol.o printer/write_array.o \ |
| 70 |
printer/write_list.o printer/write_code.o printer/write_sse.o \ |
| 71 |
printer/print_unreadable.o |
| 72 |
|
| 73 |
READER_OBJS = read.o reader/parse_integer.o reader/parse_number.o |
| 74 |
|
| 75 |
STREAM_OBJS = stream.o file.o streams/strm_os.o streams/strm_clos.o \ |
| 76 |
streams/strm_string.o streams/strm_composite.o streams/strm_common.o \ |
| 77 |
streams/strm_sequence.o streams/strm_eformat.o streams/strm_binary.o |
| 78 |
|
| 79 |
FFI_OBJS = ffi.o ffi/libraries.o ffi/backtrace.o ffi/mmap.o ffi/cdata.o |
| 80 |
|
| 81 |
OBJS = main.o symbol.o package.o cons.o list.o apply.o eval.o interpreter.o \ |
| 82 |
compiler.o disassembler.o reference.o character.o error.o \ |
| 83 |
string.o cfun.o typespec.o assignment.o memory.o predicate.o array.o \ |
| 84 |
vector_push.o sequence.o cmpaux.o macros.o backq.o stacks.o time.o \ |
| 85 |
unixint.o mapfun.o multival.o hash.o format.o pathname.o structure.o \ |
| 86 |
load.o unixfsys.o unixsys.o serialize.o sse2.o atomic.o process.o \ |
| 87 |
$(BOOT_OBJS) $(NUM_OBJS) $(WRITER_OBJS) $(READER_OBJS) $(STREAM_OBJS) \ |
| 88 |
$(CLOS_OBJS) $(FFI_OBJS) @EXTRA_OBJS@ |
| 89 |
|
| 90 |
.PHONY: all |
| 91 |
|
| 92 |
ifndef VERBOSE |
| 93 |
.SILENT: |
| 94 |
endif |
| 95 |
|
| 96 |
all: $(DPP) ../libeclmin.a ../cinit.o |
| 97 |
|
| 98 |
$(HDIR)/impl/%.h: $(top_srcdir)/h/impl/%.h |
| 99 |
mkdir -p $(HDIR)/impl |
| 100 |
cp $< $@ |
| 101 |
|
| 102 |
$(HDIR)/%.h: $(top_srcdir)/h/%.h |
| 103 |
cp $< $@ |
| 104 |
|
| 105 |
%.c: %.d $(DPP) |
| 106 |
if test -f ../CROSS-DPP ; then ../CROSS-DPP $< $@ ; else $(DPP) $< $@ ; fi |
| 107 |
%.o: %.d $(DPP) $(HFILES) |
| 108 |
if test -f ../CROSS-DPP ; then ../CROSS-DPP $< [email protected] ; else $(DPP) $< [email protected] ; fi |
| 109 |
$(CC) -DECLDIR="\"@ecldir@\"" $(CFLAGS) -o $@ [email protected] |
| 110 |
%.o: %.c $(HFILES) |
| 111 |
$(CC) -DECLDIR="\"@ecldir@\"" $(CFLAGS) -o $@ $< |
| 112 |
|
| 113 |
../libeclmin.a: $(OBJS) all_symbols.o all_symbols2.o |
| 114 |
$(RM) $@ |
| 115 |
$(AR) cr $@ $(OBJS) |
| 116 |
$(RANLIB) $@ |
| 117 |
|
| 118 |
clean: |
| 119 |
$(RM) $(DPP) *.c *.h $(OBJS) all_symbols.o all_symbols2.o ../libecl.a ../cinit.o core a.out tmp.c |
| 120 |
|
| 121 |
# Build rules |
| 122 |
|
| 123 |
$(DPP): $(srcdir)/dpp.c $(srcdir)/symbols_list.h |
| 124 |
if test -f ../CROSS-DPP; then touch $(DPP); else \ |
| 125 |
$(TRUE_CC) -I$(srcdir) -I@true_builddir@ -I./ $(srcdir)/dpp.c @CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@ @LDFLAGS@ -o $@ ; \ |
| 126 |
fi |
| 127 |
|
| 128 |
$(OBJS): $(DPP) |
| 129 |
|
| 130 |
# |
| 131 |
# This reduces the overhead of jumping to other functions |
| 132 |
# |
| 133 |
# apply.c: $(DPP) |
| 134 |
# apply.o: apply.c $(HFILES) |
| 135 |
# $(CC) $(CFLAGS) apply.c -o $@ |
| 136 |
|
| 137 |
# |
| 138 |
# These files are interrelated |
| 139 |
# |
| 140 |
all_symbols.c: $(DPP) |
| 141 |
all_symbols.o: all_symbols.c |
| 142 |
$(CC) $(CFLAGS) -I./ all_symbols.c -o $@ |
| 143 |
all_symbols2.o: all_symbols.c |
| 144 |
$(CC) $(CFLAGS) -DECL_FINAL -I./ all_symbols.c -o $@ |
| 145 |
|
| 146 |
# |
| 147 |
# This is in another directory |
| 148 |
# |
| 149 |
cinit.c: $(DPP) |
| 150 |
../cinit.o: cinit.c $(HFILES) |
| 151 |
$(CC) $(CFLAGS) -I./ cinit.c -o $@ |