File: Makefile

package info (click to toggle)
gplanarity 17906-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 732 kB
  • sloc: ansic: 8,776; makefile: 131; perl: 17; sed: 2
file content (105 lines) | stat: -rw-r--r-- 3,621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Fuck Automake
# Fuck the horse it rode in on
# and Fuck its little dog Libtool too

TARGET  = gPlanarity
CC      = gcc 
LD      = $(CC)
PKG_CONFIG ?= pkg-config
export INSTALL = install
PREFIX  = $(DESTDIR)/usr
BINDIR  = $(PREFIX)/games
ETCDIR  = /etc/$(TARGET)
MANDIR  = $(PREFIX)/man

#DISABLE_NLS = true
# White space delimited list of locales you want to support. Defaults to all
# available ones.
#export WANT_LINGUAS := cs

# All subdirs with Makefiles

SUBDIRS = 

# By default, enable NLS
ifeq ($(origin DISABLE_NLS), undefined)
export GT_DOMAIN = $(TARGET)
export GT_DIR = $(PREFIX)/share/locale
ADD_DEF += -DUGT_DOMAIN="$(GT_DOMAIN)" -DUGT_DIR="$(GT_DIR)" -DENABLE_NLS
SUBDIRS += po
endif

SRC  = dialog_finish.c gameboard_logic.c dialog_pause.c gameboard_logic_button.c\
	gameboard.c gameboard_logic_buttonbar.c gameboard_draw_box.c\
	gameboard_logic_mouse.c gameboard_draw_button.c gameboard_logic_push.c\
	gameboard_draw_buttonbar.c graph.c gameboard_draw_curtain.c\
	graph_score.c graph_arrange.c gameboard_draw_edge.c graph_generate.c\
	gameboard_draw_intersection.c graph_generate_mesh1.c gameboard_draw_main.c\
	gameboard_draw_score.c main.c gameboard_draw_selection.c\
	timer.c gameboard_draw_vertex.c levelstate.c dialog_level.c\
	dialog_level_icons.c gameboard_draw_text.c random.c graph_generate_data.c\
	gameboard_logic_fade.c graph_generate_mesh2.c graph_region.c
OBJ  = dialog_finish.o gameboard_logic.o dialog_pause.o gameboard_logic_button.o\
	gameboard.o gameboard_logic_buttonbar.o gameboard_draw_box.o\
	gameboard_logic_mouse.o gameboard_draw_button.o gameboard_logic_push.o\
	gameboard_draw_buttonbar.o graph.o gameboard_draw_curtain.o\
	graph_score.o graph_arrange.o gameboard_draw_edge.o graph_generate.o\
	gameboard_draw_intersection.o graph_generate_mesh1.o gameboard_draw_main.o\
	gameboard_draw_score.o main.o gameboard_draw_selection.o\
	timer.o gameboard_draw_vertex.o levelstate.o dialog_level.o\
	dialog_level_icons.o gameboard_draw_text.o random.o graph_generate_data.o\
	gameboard_logic_fade.o graph_generate_mesh2.o graph_region.o
CAIROVER =  >= 1.0.0
GTKVER   =  >= 2.7.2
GCF  = `$(PKG_CONFIG) --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2"`
LDF  = `$(PKG_CONFIG) --libs "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2"`

all: all-local all-recursive

all-local:    
	$(PKG_CONFIG) --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null
	$(MAKE) target CFLAGS='$(CFLAGS) -ffast-math $(GCF) $(ADD_DEF)'

all-recursive:
	for D in $(SUBDIRS); do make -C $$D || exit 1; done

debug:
	$(PKG_CONFIG) --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null
	$(MAKE) target CFLAGS='-g -Wall -W -Wno-unused-parameter -D__NO_MATH_INLINES $(GCF) $(ADD_DEF)'

profile:
	$(PKG_CONFIG) --cflags "gtk+-2.0 $(GTKVER) cairo $(CAIROVER) freetype2" 1>/dev/null
	$(MAKE) target CFLAGS='-pg -g -O2 -ffast-math $(GCF) $(ADD_DEF)" LIBS="$(LIBS) -lgprof-helper'

clean: clean-local clean-recursive

clean-local:
	rm -f $(OBJ) *.d *.d.* gmon.out $(TARGET)

clean-recursive:
	for D in $(SUBDIRS); do make -C $$D clean || exit 1; done


distclean: clean
	rm -f *~

%.d: %.c
	$(CC) -M $(CFLAGS) $< > $@.$$$$; sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; rm -f $@.$$$$

ifeq ($(MAKECMDGOALS),target)
include $(SRC:.c=.d)
endif

target: $(TARGET)
$(TARGET): $(OBJ)
	./touch-version
	$(LD) $(OBJ) $(LDFLAGS) -o $(TARGET) $(LIBS) $(LDF) -lm

install: install-local install-recursive

install-local: target
	$(INSTALL) -d -m 0755 $(BINDIR)
	$(INSTALL) -m 0755 $(TARGET) $(BINDIR)

install-recursive:
	for D in $(SUBDIRS); do make -C $$D install || exit 1; done