GNUmakefile 4.63 KB
Newer Older
rtoy's avatar
rtoy committed
1
# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/GNUmakefile,v 1.39 2010/10/14 17:47:12 rtoy Exp $
wlott's avatar
wlott committed
2

3
4
5
6
7
8
9
10
11
12
13
14
15
# These tell gmake where to look for .h, .c and .S files.  Mostly for
# building the binary outside of the src tree.

PATH1 = ../../src/lisp
vpath %.h $(PATH1)
vpath %.c $(PATH1)
vpath %.S $(PATH1)

CMULOCALE = ../../src/i18n/locale
vpath %.pot $(CMULOCALE)
vpath %.po  $(CMULOCALE)
vpath %.mo  $(CMULOCALE)

16
all: lisp.nm
wlott's avatar
wlott committed
17

18

19
-include internals.inc
wlott's avatar
wlott committed
20
21
include Config

Raymond Toy's avatar
Raymond Toy committed
22
23
24
25
26
27
FDLIBM = k_sin.c k_cos.c k_tan.c s_sin.c s_cos.c s_tan.c sincos.c \
	s_log1p.c s_expm1.c e_pow.c e_exp.c e_log.c \
	e_acos.c e_asin.c s_atan.c \
	e_cosh.c e_sinh.c s_tanh.c \
	e_acosh.c s_asinh.c e_atanh.c \
	e_atan2.c \
28
	e_rem_pio2.c k_rem_pio2.c \
Raymond Toy's avatar
Raymond Toy committed
29
	e_log10.c s_scalbn.c \
30
31
	setexception.c \
	log2.c
Raymond Toy's avatar
Raymond Toy committed
32

33
SRCS = lisp.c coreparse.c alloc.c monitor.c print.c interr.c \
ram's avatar
ram committed
34
	vars.c parse.c interrupt.c search.c validate.c globals.c \
wlott's avatar
wlott committed
35
	dynbind.c breakpoint.c regnames.c backtrace.c save.c purify.c \
36
	runprog.c time.c exec-init.c \
Raymond Toy's avatar
Raymond Toy committed
37
	${FDLIBM} ${ARCH_SRC} ${ASSEM_SRC} ${OS_SRC} ${GC_SRC}
38

39
OBJS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(patsubst %.s,%.o,$(SRCS))))
wlott's avatar
wlott committed
40
41
42
43

### Don't look in RCS for the files, because we might not want the latest.
%: RCS/%,v

44
lisp.nm: lisp lisp.a
45
	echo 'Map file for lisp version ' `cat version` > ,lisp.nm
46
	$(NM) lisp | grep -v " [F] " >> ,lisp.nm
wlott's avatar
wlott committed
47
48
	mv ,lisp.nm lisp.nm

49
version.o : version.c version
Raymond Toy's avatar
Raymond Toy committed
50
	expr 1 + `cat version` > ,version
wlott's avatar
wlott committed
51
	mv ,version version
rtoy's avatar
rtoy committed
52
	$(CC) ${CFLAGS} $(CPPFLAGS) -DVERSION=`cat version` -c $<
53
54

lisp: ${OBJS} version.o
Raymond Toy's avatar
Raymond Toy committed
55
	$(CC) -g ${OS_LINK_FLAGS} -o ,lisp $^ ${OS_LIBS} -lm
wlott's avatar
wlott committed
56
57
	mv -f ,lisp lisp

58
# Create a library out of all the object files so we can build an
59
# executable.  However, we need to remove exec-init.o from the library
60
lisp.a:	version.o ${OBJS} ${EXEC_FINAL_OBJ}
61
	$(AR) crs lisp.a ${OBJS} version.o
rtoy's avatar
rtoy committed
62
ifneq (${EXEC_FINAL_OBJ},)
63
	$(AR) d lisp.a exec-init.o
64
endif
65

wlott's avatar
wlott committed
66
67
68
version:
	echo 0 > version

69
internals.h internals.inc:
wlott's avatar
wlott committed
70
71
72
73
	@echo "You must run genesis to create internals.h!"
	@false

clean:
74
	$(RM) Depends *.o lisp lisp.nm core lisp.a
75
	echo 'Map file for lisp version 0' > lisp.nm
wlott's avatar
wlott committed
76

77
78
79
depend: Depends

Depends: ${SRCS}
Raymond Toy's avatar
Raymond Toy committed
80
	$(CC) ${DEPEND_FLAGS} ${CFLAGS} ${CPPFLAGS} $^ > ,depends
wlott's avatar
wlott committed
81
82
	mv ,depends Depends

83
-include Depends
84
85
86
87
88
89
90
91
92
93
94
95

# Find all directories in ../i18n/locale.  These are the locales we
# currently support.

# This would be a nice way to do it so we don't have to keep track of
# the directories, but Solaris' find doesn't grok -depth 1
#LOCALES=$(patsubst ../i18n/locale/%, %, $(shell find ../i18n/locale -type d -depth 1))
LOCALES=en@piglatin ko

# Convert locale names to the appropriate path where we want the mo files to go.
LOCALE_DIRS = $(patsubst %, i18n/locale/%/LC_MESSAGES, $(LOCALES))

rtoy's avatar
rtoy committed
96
97
98
99
100
101
102
103
104
105
106
107
# When processing the translations, we merge the po file from the src
# directory with the appropriate pot file.  The result is placed in
# the build directory.  Then we compare the original po file with the
# newly generated one (but sorting both before comparing).  If they
# are different we print out a note so that we know to look into it
# and decide if the po file in the src directory needs to be updated.
#
# The sorting is done so that differences in order of the lines is not
# important.  In particular, msgmerge on OSX wants to put the
# Language: line after the Content-Transfer-Encoding line.  But on
# FreeBSD, it moves the line to after the Language-Team line.  This
# makes things messy.  Hence, sort and diff.
108
109
110
111
112
113
114
translations: 
	for pot in ../../src/i18n/locale/*.pot; do \
	  for po in $(LOCALE_DIRS); do \
            d=`dirname $$pot`; \
	    f=`basename $$pot .pot`; \
	    echo ; \
	    echo '***' Processing $$f.pot:  $$po; \
rtoy's avatar
rtoy committed
115
116
117
118
119
120
	    msgmerge -v ../../src/$$po/$$f.po $$pot -o ../$$po/$$f.po; \
	    msgfmt -v  ../$$po/$$f.po -o ../$$po/$$f.mo; \
	    sort < ../$$po/$$f.po > /tmp/$$$$-updated-$$f.po; \
	    sort < ../../src/$$po/$$f.po > /tmp/$$$$-orig-$$f.po; \
	    diff -uwB /tmp/$$$$-orig-$$f.po /tmp/$$$$-updated-$$f.po || echo "Warning:  $$po/$$f.po changed"; \
	    rm -f /tmp/$$$$-updated-$$f.po /tmp/$$$$-orig-$$f.po; \
121
122
123
124
	  done; done

.PHONY : translations

rtoy's avatar
rtoy committed
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Like translations, but we don't compute the diff.  We just overwrite
# the po files in the repository so that we can tell if the
# translations have changed and need to be updated.  (This is what the
# old translations used to do.)
translations-update: 
	for pot in ../../src/i18n/locale/*.pot; do \
	  for po in $(LOCALE_DIRS); do \
            d=`dirname $$pot`; \
	    f=`basename $$pot .pot`; \
	    touch ../../src/$$po/$$f.po; \
	    echo ; \
	    echo '***' Processing $$f.pot:  $$po; \
	    msgmerge -v ../../src/$$po/$$f.po $$pot -o ../../src/$$po/$$f.po; \
	    msgfmt -v  ../../src/$$po/$$f.po -o ../$$po/$$f.mo; \
	  done; done

141