summaryrefslogtreecommitdiff
path: root/source/3-final/Makefile
blob: a73df9dc417de88e6a03ae1d0a1dd60a96d568d4 (plain)
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
SRCDIR=src
EDJDIR=data/edc
OBJECTS=$(SRCDIR)/main.o
BINARY=sample
DIRNAME=sample

PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
DATADIR=$(PREFIX)/share/sample

CC = gcc

CFLAGS = `pkg-config --cflags elementary evas`
CFLAGS +=  -g -W -Wextra #-Wall
LDFLAGS = `pkg-config --libs elementary evas`

all: $(OBJECTS) $(BINARY) theme

%.o : %.c
	@echo "  Compilation of $(@D)/$(<F)"
	@$(CC) -c $(CFLAGS) $< -o $@

$(BINARY): $(OBJECTS)
	@echo "  Linking  $(@F)"
	@$(CC) -o $(BINARY) $(OBJECTS) $(LDFLAGS)

theme:
	$(MAKE) -C $(EDJDIR)

theme_install:
	$(MAKE) -C $(EDJDIR) install

theme_clean:
	$(MAKE) -C $(EDJDIR) clean

install: $(BINARY) theme_install
	@echo "installation of executables"
	@mkdir -p $(BINDIR)
	@install -m 0755 $(BINARY) $(BINDIR)
	@echo "installation of data"
	@mkdir -p $(DATADIR)/images
	@install data/images/* $(DATADIR)/images

uninstall:
	rm -rf $(DATADIR)
	rm -rf $(BINDIR)/$(BINARY)

clean: theme_clean
	@rm -f src/*.o *~ $(BINARY)