]> git.lyx.org Git - lyx.git/blob - forms/makefile
d8f6feba8050394b3d5e1a613d31a11337a6ab7d
[lyx.git] / forms / makefile
1 ###/* This file is part of
2 ###* ======================================================
3 ###*
4 ###*           LyX, the High Level Word Processor
5 ###*
6 ###*           Copyright (C) 1995-99 The LyX Team
7 ###*
8 ###*======================================================*/
9 ###
10 ###
11 ### Makefile by Lars Gullik Bjønnes (larsbj@ifi.uio.no)
12 ###  
13
14 SHELL = /bin/sh
15 .SUFFIXES: .fd .c
16
17 # Various commands
18 FDESIGN = fdesign
19
20 SRCS = bullet_forms.fd credits_form.fd form1.fd \
21         log_form.fd layout_forms.fd lyx.fd lyx_sendfax.fd math_forms.fd \
22         print_form.fd sp_form.fd
23
24 OBJS = bullet_forms.c credits_form.c form1.c \
25         log_form.c layout_forms.c lyx.c lyx_sendfax.c math_forms.c \
26         print_form.c sp_form.c
27
28 COBJS = bullet_forms.C credits_form.C form1.C \
29         log_form.C layout_forms.C lyx.C lyx_sendfax.C math_forms.C \
30         print_form.C sp_form.C
31
32 all:
33         @echo "This is a makefile intended for the maintainer only."
34         @echo "Only run it if you are absolutely sure about what you"
35         @echo "are doing."
36
37 c: $(OBJS)
38
39 d: c $(COBJS)
40
41 #
42 # -e 's/\(extern\) \(void.*FL_OBJECT\)/\1 "C" \2/'
43 #
44 # We need the callbacks to all be declared as:  extern "C" void
45 #
46 # -e 's,\(generated with fdesign\)\(.*\)\(\*\*/\),\1 \3,';\
47 #
48 # Clean up the line with the date in it.  This means we'll have fewer false
49 # updates (where the only thing that changed was the date).
50 #
51 e: c
52         for hfil in *.h ; do \
53                 if [ -f "$$hfil.patch" ] ; then \
54                         (echo "Patching $$hfil with $$hfil.patch" ; \
55                         patch -s $$hfil < $$hfil.patch) \
56                 fi; \
57                 sed < $$hfil > $$hfil.tmp \
58                         -e 's/\(extern\) \(void.*FL_OBJECT\)/\1 "C" \2/' \
59                         -e 's,\(generated with fdesign\)\(.*\)\(\*\*/\),\1 \3,';\
60                 mv $$hfil.tmp $$hfil; \
61         done
62
63 updatesrc: d e
64         @echo
65         @echo "Beware some files may be installed in the wrong directory!" >&2
66         @echo "In particular be careful with gui-indep forms.  Make sure">&2
67         @echo "they have been removed from the files here otherwise we'll">&2
68         @echo "get junk code and errors at compile time.">&2
69         for fil in *.C *.h ; do \
70                 if [ $$fil = "math_forms.C" -o $$fil = "math_forms.h" ]; then \
71                         cp $$fil ../src/mathed ; \
72                 else \
73                         cp $$fil ../src ; \
74                 fi \
75         done
76
77 .fd.c:
78         $(FDESIGN) -convert $<
79
80 .c.C:
81         ./fdfix.sh $< $@
82
83 clean:
84         rm -f *.[hcC] *.bak
85
86 distclean: clean
87         rm -f *.orig *.rej *~