From 4a123826cd504b1fccdbb711d772e2904d25b068 Mon Sep 17 00:00:00 2001 From: schodet Date: Sun, 13 Mar 2005 20:30:18 +0000 Subject: Ajout des nouveaux modules. minor fixes. --- 2005/i/robert/src/Makefile.defs | 37 +++++++++++++++++++++++---- 2005/i/robert/src/log/Makefile.defs | 2 +- 2005/i/robert/src/scheduler/test_scheduler.cc | 2 +- 2005/i/robert/src/timer/test_timer.cc | 1 + 4 files changed, 35 insertions(+), 7 deletions(-) (limited to '2005/i/robert/src') diff --git a/2005/i/robert/src/Makefile.defs b/2005/i/robert/src/Makefile.defs index 3415c27..3c8e957 100644 --- a/2005/i/robert/src/Makefile.defs +++ b/2005/i/robert/src/Makefile.defs @@ -1,14 +1,32 @@ -CXXFLAGS = -O2 -Wall -g +CXXFLAGS = -Wall -g CPPFLAGS = -MMD $(INCLUDES) -INCLUDES = -I$(SRCDIR) +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 = log serial timer \ - utils utils/meta \ - scheduler +SUBDIRS = utils utils/meta \ + log serial timer \ + config image scheduler \ + video4linux LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH) +LEX = flex +YACC = bison + VPATH = $(SUBDIRS:%=$(SRCDIR)/%) PROGRAMS = @@ -23,11 +41,20 @@ 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 diff --git a/2005/i/robert/src/log/Makefile.defs b/2005/i/robert/src/log/Makefile.defs index 21c55fe..8462793 100644 --- a/2005/i/robert/src/log/Makefile.defs +++ b/2005/i/robert/src/log/Makefile.defs @@ -2,6 +2,6 @@ PROGRAMS += test_log log_OBJECTS = log.o log_message.o -test_log_OBJECTS = test_log.o log.o log_message.o +test_log_OBJECTS = test_log.o $(log_OBJECTS) test_log: $(test_log_OBJECTS) diff --git a/2005/i/robert/src/scheduler/test_scheduler.cc b/2005/i/robert/src/scheduler/test_scheduler.cc index 8f87e4f..6cb88c0 100644 --- a/2005/i/robert/src/scheduler/test_scheduler.cc +++ b/2005/i/robert/src/scheduler/test_scheduler.cc @@ -55,7 +55,7 @@ main (void) SchedulableReadFd srf (ev, 0); s.insert (srf); std::cout << "start at " << Timer::getProgramTime () << std::endl; - SchedulableAlarm sa1 (utils::bind (to, "1s"), 1000); + SchedulableAlarm sa1 (bind (to, "1s"), 1000); s.insert (sa1); s.schedule (10000); } diff --git a/2005/i/robert/src/timer/test_timer.cc b/2005/i/robert/src/timer/test_timer.cc index a2c9380..2e8c502 100644 --- a/2005/i/robert/src/timer/test_timer.cc +++ b/2005/i/robert/src/timer/test_timer.cc @@ -30,6 +30,7 @@ int main (void) { + using namespace std; cout << "timer 0 " << Timer::getProgramTime () << ' ' << Timer::getRoundTime () << endl; sleep (1); -- cgit v1.2.3