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
|
#
# Makefile for samuel
#
TOPDIR := ..
include $(TOPDIR)/make.common
CFILES = samain.c lex.c parser.c functions.c
HFILES = samuel.h tokens.h
OFILES = $(CFILES:.c=.o)
PFILES = $(CFILES:.c=.op)
all: samuel
profil: samuel_p
# Do you want the readline version of samuel?
# Select either "readline" (GNU readline), "editline" (a smaller clone)
# or "none" (no line editing -- this is not recommended).
READLINE := readline
RLLIB :=
ifeq ($(READLINE),editline)
CPPFLAGS += -DUSE_READLINE
RLLIB := -ledit -ltermcap
endif
ifeq ($(READLINE),readline)
CPPFLAGS += -DUSE_READLINE
RLLIB := -lreadline -lhistory -ltermcap
endif
samuel: $(OFILES) $(LIBDIR)/libsaml.a
$(CC) $(LDFLAGS) -o $@~ $(OFILES) -lsaml $(RLLIB)
mv $@~ $@
samuel_p: $(PFILES) $(LIBDIR)/libsaml_p.a
$(CC) $(LDFLAGS) -pg -static -o $@~ $(PFILES) -lsaml_p $(RLLIB)
mv $@~ $@
veryclean: clean
rm -f *.s *.orig parser.c tokens.h samuel samuel_p
tokens.h: parser.c
parser.c: samuel.y
$(YACC) -dv $<
cmp -s y.tab.h tokens.h || mv y.tab.h tokens.h
rm -f y.tab.h
mv y.tab.c parser.c
include .depend
|