Debian Codegraph @

o/makefile

raw ◀ ▶
Source reconstructed at patch state 0 of 3 — not the installed (fully patched) source.
3 Debian patches touch this file
1 # make .d more important by clearing suffixes.
2 .SUFFIXES:
3 .SUFFIXES: .d .o .c .ini
4
5 -include ../makedefs
6
7 HDIR := ../h
8 DEFS := -I../h -I../gcl-tk
9 GCLIB := gcllib.a
10 RANLIB := ranlib
11 AR := ar qc
12 LIBFILES :=$(addsuffix .o,bcmp bcopy bzero user_init user_match)
13 DPP := ../bin/dpp$(EXE)
14 DECL := $(HDIR)/new_decl.h
15 ALIB := ${LIBFILES} ${EXTRA_LIB}
16
17
18 OBJS:=$(addsuffix .o,typespec main alloc gbc bitop eval macros lex bds frame predicate reference assignment\
19 bind let conditional block iteration mapfun prog multival catch symbol cfun cmpaux package big number\
20 num_pred num_comp num_arith num_sfun num_co num_log num_rand earith character sequence list hash\
21 array string regexpr structure toplevel file read backq print format pathname unixfsys unixfasl\
22 error unixtime unixsys unixsave funlink fat_string run_process nfunlink usig usig2 utils makefun\
23 sockets clxsocket init_pari nsocket sfasl prelink gprof)
24 OBJS:=$(OBJS) $(RL_OBJS) $(EXTRAS)
25
26 INI_FILES=$(patsubst %.o,%.ini,${OBJS})
27 INI_FILES:=$(filter-out new_init.ini,$(filter-out boot.ini,$(INI_FILES)))
28
29 OBJECTS:=$(OBJS) $(LIBFILES) new_init.o $(GCLIB) $(LAST_FILE) $(FIRST_FILE)
30
31 all: $(OBJECTS)
32
33 boot.o: boot.c $(DECL) boot.h
34 $(CC) -c $(CFLAGS) $(DEFS) -fPIC $*.c $(AUX_INFO)
35
36 gprof.o: gprof.c $(DECL)
37 $(CC) -c $(filter-out -fomit-frame-pointer,$(CFLAGS)) $(DEFS) -pg $*.c $(AUX_INFO)
38
39 prelink.o: prelink.c $(DECL)
40 $(CC) -c $(filter-out -pg,$(CFLAGS)) -fPIE $(DEFS) $*.c $(AUX_INFO)
41
42 %.o: %.c $(DECL)
43 $(CC) -c $(CFLAGS) $(DEFS) $*.c $(AUX_INFO)
44
45 %.c: %.d $(DPP)
46 $(DPP) $*
47
48 %.o: %.d $(DECL)
49 $(DPP) $*
50 $(CC) -c $(CFLAGS) $(DEFS) $*.c $(AUX_INFO)
51 rm $*.c
52
53 boot.ini: boot.c grab_defs
54 $(CC) -DINICOMP -DNO_DEFUN -DNO_BOOT_H $(CFLAGS) $(DEFS) -E $*.c |\
55 sed -e 's,DEFUN,\nDEFUN,g' -e 's,^.* DEFUNB,DEFUNB,g' -e 's/DEF,//g' -e 's:\"[ ]*):\"):g' | ./grab_defs > $@
56
57 boot.h: boot.ini
58 echo '#include "make-init.h"' > $@
59 echo 'void gcl_init_boot(void){' >> $@
60 cat $< >> $@
61 echo '}' >> $@
62
63 %.ini: %.c grab_defs
64 $(CC) -DINICOMP -DNO_DEFUN $(CFLAGS) $(DEFS) -E $*.c |\
65 sed -e 's,^.* DEFUNB,DEFUNB,g' -e 's/DEF,//g' -e 's:\"[ ]*):\"):g' | ./grab_defs > $*.ini
66
67 %.ini: %.d $(DPP) grab_defs
68 $(DPP) $*
69 $(CC) -DINICOMP -DNO_DEFUN $(CFLAGS) $(DEFS) -E $*.c |\
70 sed -e 's,^.* DEFUNB,DEFUNB,g' -e 's/DEF,//g' | sed -e 's:\"[ ]*):\"):g' | ./grab_defs > $*.ini
71 rm $*.c
72
73 $(DPP): ../bin/dpp.c
74 ${CC} ${DEFS} -o $@ $<
75
76 new_init.c: ${INI_FILES}
77 echo '#include "make-init.h"' > $@
78 echo 'void NewInit(void){' >> $@
79 cat ${INI_FILES} >> $@
80 echo '}' >> $@
81 ! cat $@ | awk -F, '/DEFUN/ {print $2}' | grep -v object || (rm $@ && false)
82
83 ifneq ($(NIFLAGS),)
84 new_init.o: new_init.c $(DECL)
85 $(CC) -c $(NIFLAGS) $(DEFS) $< -o $@
86 endif
87
88 $(DECL): $(HDIR)/make-decl.h $(INI_FILES)
89 echo '#include "make-decl.h"' > foo.c
90 cat ${INI_FILES} |sed 's,DEFBFUN,DEFUN,g' >> foo.c
91 ${CC} -E -I${HDIR} foo.c | sed -n -e '/#/d' -e '/DO_/d' -e '/[a-zA-Z;]/p' > tmpini
92 ../xbin/move-if-changed mv tmpini $@
93 rm -f foo.c tmpini
94
95 grab_defs: grab_defs.c
96 ${CC} $(OFLAGS) -o grab_defs grab_defs.c
97
98 wpool: wpool.o
99 $(CC) $(LDFLAGS) -o $@ $<
100
101 $(GCLIB): ${ALIB}
102 rm -f gcllib.a
103 $(AR) gcllib.a ${ALIB}
104 ${RANLIB} gcllib.a
105
106 clean:
107 rm -f $(OBJS) ${ALIB} new_init.o $(LAST_FILE) $(FIRST_FILE) *.a grab_defs$(EXE) *.ini tmpx foo.c
108 rm -f cmpinclude.h new_init.c $(DECL) def undef udef.h void.h TAGS boot.h wpool
109
110 .INTERMEDIATE: $(patsubst %.d,%.c,$(shell ls -1 *.d))