summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/Makefile.defs
blob: 99ad8485d49a7069919ee3e0388e465c98429428 (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
51
52
53
54
55
56
57
58
59
60
CXXFLAGS = -Wall -g
CPPFLAGS = -MMD $(INCLUDES)
INCLUDES = -I$(SRCDIR) -I.

ifeq ($(COV),)
CXXFLAGS += -O2
else
CXXFLAGS += -fprofile-arcs -ftest-coverage
endif

ifneq ($(PROF),)
CXXFLAGS += -pg
LDFLAGS += -pg
endif

# Messages sur une ligne.
CXXFLAGS += -fmessage-length=0

# Attention, il y a un probl�me de d�pendences dans l'ordre des SUBDIRS �
# cause de la g�n�ration des r�gles.
SUBDIRS = utils utils/meta \
	  log serial timer \
	  config data image scheduler \
	  video4linux

LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
LEX = flex
YACC = bison

VPATH = $(SUBDIRS:%=$(SRCDIR)/%)

PROGRAMS =
LIBS =

all: build-all
	
# Inclus les autres r�pertoires.
include $(SUBDIRS:%=$(SRCDIR)/%/Makefile.defs)

OBJECTS = $(filter %.o,$(foreach PROGRAM,$(PROGRAMS),$($(PROGRAM)_OBJECTS)))

build-all: $(PROGRAMS)

# R�gles.
%.cc: %.ll
	$(LEX) $<

%.cc: %.yy
	$(YACC) -o $@ $<

# D�pendances.
-include $(OBJECTS:%.o=%.d)

# M�nage.
clean:
	rm -f *.o *.d $(PROGRAMS)
	rm -f *.bbg *.bb *.da *.gcov
	rm -f gmon.out

.PHONY: all build-all clean