2 # Fuck the horse it rode in on
3 # and Fuck its little dog Libtool too
15 LDCONFIG
= /sbin
/ldconfig
17 VERSION
= $(MAJOR
).
$(MINOR
).
$(SUBMINOR
)
18 TARGET
= lib
$(NAME
).so.
$(VERSION
)
19 BINDIR
= $(PREFIX
)/bin
20 INCDIR
= $(PREFIX
)/include
21 LIBDIR
= $(PREFIX
)/lib
22 ETCDIR
= /etc
/$(TARGET
)
23 MANDIR
= $(PREFIX
)/man
25 SOLDFLAGS
= -shared
-nostdlib
-Wl
,-soname
="lib$(NAME).so.$(MAJOR)"
27 SRC
= toplevel.c mapping.c scale.c plot.c slider.c slice.c spinner.c objective.c panel.c \
28 plane-2d.c dimension.c function.c undo.c gtksucks.c xml.c \
29 tokens.c example_fractal.c example_discrete.c example_chirp.c example_spirograph.c
30 INC
= sushivision.h sushimacro.h
32 EXAMPLES
= sushivision_fractal
#sushivision_discrete sushivision_chirp
33 EX_OBJ
= example_fractal.o
#example_discrete.o example_chirp.o example_spirograph.o
34 OBJ
= toplevel.o mapping.o scale.o plot.o slider.o slice.o spinner.c objective.o panel.o \
35 plane-2d.o dimension.o function.o undo.o gtksucks.o xml.o tokens.c
39 PKGARG
= "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) cairo-ft $(CAIROVER) gthread-2.0 libxml-2.0"
40 GCF
= -std
=gnu99
`pkg-config --cflags $(PKGARG)`
41 LDF
= -pthread
-L
/lib
-ldl
-rdynamic
`pkg-config --libs $(PKGARG)`
44 pkg-config
--cflags $(PKGARG
) 1>/dev
/null
45 $(MAKE
) target CFLAGS
='-O2 -g $(SOCFLAGS) $(GCF) $(ADD_DEF)'
46 $(MAKE
) examples CFLAGS
='-O2 -g $(GCF) $(ADD_DEF)'
49 pkg-config
--cflags $(PKGARG
) 1>/dev
/null
50 $(MAKE
) target CFLAGS
='-g -Wall -W -Wno-unused-parameter -D__NO_MATH_INLINES $(SOCFLAGS) $(GCF) $(ADD_DEF)'
51 $(MAKE
) examples CFLAGS
='-g -Wall -W -Wno-unused-parameter -D__NO_MATH_INLINES $(GCF) $(ADD_DEF)'
54 pkg-config
--cflags $(PKGARG
) 1>/dev
/null
55 $(MAKE
) examples CFLAGS
='-pg -g -O2 $(GCF) $(ADD_DEF)'
58 rm -f
*.o
*.d
*.d.
* *.
pc gmon.out
$(TARGET
) sushivision_
* sushi-gtkrc.h
64 $(CC
) -M
$(CFLAGS
) $< > $@.
$$$$; sed
's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.
$$$$ > $@
; rm -f
$@.
$$$$
68 ifeq ($(MAKECMDGOALS
),target
)
72 ifeq ($(MAKECMDGOALS
),static-target
)
76 sushivision.
pc: Makefile
79 echo
"prefix = $(PREFIX)" >> sushivision.
pc
80 echo
"version = $(VERSION)" >> sushivision.
pc
81 echo
"gtkver = $(GTKVER)" >> sushivision.
pc
82 echo
"cairover = $(CAIROVER)" >> sushivision.
pc
83 cat sushivision.
pc.in
>> sushivision.
pc
85 sushi-gtkrc.h
: sushi-gtkrc.in
88 echo
"static char *_SUSHI_GTKRC_STRING=" >> sushi-gtkrc.h
89 sed
-e
's/\(\"\)/\\\"/g' -e
's/^\(.*\)$$/"\1\\n"/' sushi-gtkrc.in
>> sushi-gtkrc.h
90 echo
"\"\";" >> sushi-gtkrc.h
92 target
: $(OBJ
) examples sushivision.
pc
93 $(LD
) $(OBJ
) $(CFLAGS
) $(SOLDFLAGS
) -o
$(TARGET
) $(LIBS
) $(LDF
)
95 examples
: $(OBJ
) $(EX_OBJ
)
96 $(LD
) $(OBJ
) example_fractal.o
$(CFLAGS
) -o sushivision_fractal
$(LIBS
) $(LDF
)
97 #$(LD) $(OBJ) example_discrete.o $(CFLAGS) -o sushivision_discrete $(LIBS) $(LDF)
98 #$(LD) $(OBJ) example_chirp.o $(CFLAGS) -o sushivision_chirp $(LIBS) $(LDF)
99 #$(LD) $(OBJ) example_spirograph.o $(CFLAGS) -o sushivision_spirograph $(LIBS) $(LDF)
104 $(INSTALL
) -d
-m
0755 $(INCDIR
)
105 $(INSTALL
) -m
0644 $(INC
) $(INCDIR
)
106 # $(INSTALL) -d -m 0755 $(MANDIR)
107 # $(INSTALL) -m 0644 $(MAN) $(MANDIR)
108 $(INSTALL
) -d
-m
0755 $(BINDIR
)
109 $(INSTALL
) -m
0755 $(EXAMPLES
) $(BINDIR
)
110 $(INSTALL
) -d
-m
0755 $(LIBDIR
)
111 $(INSTALL
) -d
-m
0755 $(LIBDIR
)/pkgconfig
112 $(INSTALL
) -m
0755 $(TARGET
) $(LIBDIR
)
113 $(INSTALL
) -m
0755 sushivision.
pc $(LIBDIR
)/pkgconfig
115 ln
-fs
$(LIBDIR
)/$(TARGET
) $(LIBDIR
)/lib
$(NAME
).so