summaryrefslogtreecommitdiff
path: root/source/3-final/Makefile
blob: 818bbb99c631f0ee836c03803ddaceec5f17c4f9 (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
50
SRCDIR=src
EDJDIR=data/edc
OBJECTS=$(SRCDIR)/main.o
EDJS=$(EDJDIR)/layout.edj
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`

EDJE_CC = edje_cc
EDJE_FLAGS = -id data/images

all: $(OBJECTS) $(BINARY) $(EDJS)

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

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

$(EDJDIR)/layout.edj: $(EDJDIR)/layout.edc
	@echo "  Compilation of $(@D)/$(<F)"
	@$(EDJE_CC) $(EDJE_FLAGS) $(EDJDIR)/layout.edc $(EDJDIR)/layout.edj

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

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

clean:
	@rm -f *.o *.edj *~ $(BINARY)