Swap code/variable declaration to be pre-C99 compliant.
[xiph/unicode.git] / planarity / Makefile
blob117ac201e8d84adb76b5f13eb44e0c265e567d0a
1 # Fuck Automake
2 # Fuck the horse it rode in on
3 # and Fuck its little dog Libtool too
5 TARGET = gPlanarity
6 CC = gcc
7 LD = gcc
8 INSTALL = install
9 STRIP = strip
10 PREFIX = /usr/local
11 BINDIR = $(PREFIX)/bin
12 ETCDIR = /etc/$(TARGET)
13 MANDIR = $(PREFIX)/man
15 # the very long LIBS entry is to build an executable that will
16 # work for on most modern linux distros without any of the
17 # bleeding-edge GTK 2.7/2.8 libs installed.
19 SRC = dialog_finish.c gameboard_logic.c dialog_pause.c gameboard_logic_button.c\
20 gameboard.c gameboard_logic_buttonbar.c gameboard_draw_box.c\
21 gameboard_logic_mouse.c gameboard_draw_button.c gameboard_logic_push.c\
22 gameboard_draw_buttonbar.c graph.c gameboard_draw_curtain.c\
23 graph_score.c graph_arrange.c gameboard_draw_edge.c graph_generate.c\
24 gameboard_draw_intersection.c graph_generate_mesh1.c gameboard_draw_main.c\
25 gameboard_draw_score.c main.c gameboard_draw_selection.c\
26 timer.c gameboard_draw_vertex.c levelstate.c dialog_level.c\
27 dialog_level_icons.c gameboard_draw_text.c random.c graph_generate_data.c\
28 gameboard_logic_fade.c graph_generate_mesh2.c graph_region.c
29 OBJ = dialog_finish.o gameboard_logic.o dialog_pause.o gameboard_logic_button.o\
30 gameboard.o gameboard_logic_buttonbar.o gameboard_draw_box.o\
31 gameboard_logic_mouse.o gameboard_draw_button.o gameboard_logic_push.o\
32 gameboard_draw_buttonbar.o graph.o gameboard_draw_curtain.o\
33 graph_score.o graph_arrange.o gameboard_draw_edge.o graph_generate.o\
34 gameboard_draw_intersection.o graph_generate_mesh1.o gameboard_draw_main.o\
35 gameboard_draw_score.o main.o gameboard_draw_selection.o\
36 timer.o gameboard_draw_vertex.o levelstate.o dialog_level.o\
37 dialog_level_icons.o gameboard_draw_text.o random.o graph_generate_data.o\
38 gameboard_logic_fade.o graph_generate_mesh2.o graph_region.o
39 CAIROVER = >= 1.0.0
40 GTKVER = >= 2.7.2
41 GCF = `pkg-config --static --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2"`
42 LDF = `pkg-config --static --libs "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2"`
44 # a build with static Gtk 2.7+ generally requires that all of the Gtk
45 # dependencies were built with static dependencies also pointing to
46 # the local install
48 SLDF = `pkg-config --static --libs-only-L "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2"`
49 GTK = /usr/local/lib
50 EXPAT= /usr/lib/libexpat.a
51 XINERAMA = /usr/X11R6/lib/libXinerama.a
52 PNG = /usr/lib/libpng.a
53 PIXMAN = /usr/lib/libpixman.a
54 SLIBS = $(GTK)/libgtk-x11-2.0.a \
55 $(GTK)/libgdk-x11-2.0.a $(GTK)/libgdk_pixbuf-2.0.a \
56 $(GTK)/libpangocairo-1.0.a $(GTK)/libpangoft2-1.0.a \
57 $(GTK)/libpangox-1.0.a $(GTK)/libpangoxft-1.0.a \
58 $(GTK)/libpango-1.0.a $(GTK)/libcairo.a \
59 $(GTK)/libatk-1.0.a $(GTK)/libgmodule-2.0.a \
60 $(GTK)/libgobject-2.0.a $(GTK)/libglib-2.0.a \
61 -lpthread $(EXPAT) -lfreetype -lz -lm -lc \
62 -lXext -lXrandr $(XINERAMA) -lXcursor -lX11 $(PIXMAN)\
63 -lXft $(PNG)
65 all:
66 pkg-config --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null
67 $(MAKE) target CFLAGS='-O2 -ffast-math $(GCF) $(ADD_DEF)'
68 $(STRIP) $(TARGET)
70 static:
71 pkg-config --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null
72 $(MAKE) static-target CFLAGS='-O2 -ffast-math $(GCF) $(ADD_DEF)'
73 # $(STRIP) $(TARGET)
75 debug:
76 pkg-config --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null
77 $(MAKE) target CFLAGS='-g -Wall -W -Wno-unused-parameter -D__NO_MATH_INLINES $(GCF) $(ADD_DEF)'
79 profile:
80 pkg-config --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null
81 $(MAKE) target CFLAGS='-pg -g -O2 -ffast-math $(GCF) $(ADD_DEF)" LIBS="$(LIBS) -lgprof-helper'
83 clean:
84 rm -f $(OBJ) *.d *.d.* gmon.out $(TARGET)
86 distclean: clean
87 rm -f *~
89 %.d: %.c
90 $(CC) -M $(CFLAGS) $< > $@.$$$$; sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$
92 ifeq ($(MAKECMDGOALS),target)
93 include $(SRC:.c=.d)
94 endif
96 ifeq ($(MAKECMDGOALS),static-target)
97 include $(SRC:.c=.d)
98 endif
100 target: $(OBJ)
101 ./touch-version
102 $(LD) $(OBJ) $(CFLAGS) -o $(TARGET) $(LIBS) $(LDF)
104 static-target: $(OBJ)
105 ./touch-version
106 $(LD) $(OBJ) $(CFLAGS) -o $(TARGET) $(SLIBS) $(SLDF)
108 install: target
109 $(INSTALL) -d -m 0755 $(BINDIR)
110 $(INSTALL) -m 0755 $(TARGET) $(BINDIR)