summaryrefslogtreecommitdiff
path: root/2003
diff options
context:
space:
mode:
Diffstat (limited to '2003')
-rw-r--r--2003/i/buzz/i386/GNUmakefile4
-rw-r--r--2003/i/buzz/mips/GNUmakefile4
-rw-r--r--2003/i/buzz/src/GNUmakefile40
-rw-r--r--2003/i/buzz/src/automate/GNUmakefile30
-rw-r--r--2003/i/buzz/src/automate/Makefile.defs5
-rw-r--r--2003/i/buzz/src/automate/lexer.ll2
-rw-r--r--2003/i/buzz/src/busp/GNUmakefile15
-rw-r--r--2003/i/buzz/src/busp/Makefile.defs4
-rw-r--r--2003/i/buzz/src/camera/GNUmakefile16
-rw-r--r--2003/i/buzz/src/camera/Makefile.defs7
-rw-r--r--2003/i/buzz/src/erreur/GNUmakefile13
-rw-r--r--2003/i/buzz/src/erreur/Makefile.defs3
-rw-r--r--2003/i/buzz/src/vision/GNUmakefile29
-rw-r--r--2003/i/buzz/src/vision/Makefile.defs7
14 files changed, 71 insertions, 108 deletions
diff --git a/2003/i/buzz/i386/GNUmakefile b/2003/i/buzz/i386/GNUmakefile
new file mode 100644
index 0000000..00dfbeb
--- /dev/null
+++ b/2003/i/buzz/i386/GNUmakefile
@@ -0,0 +1,4 @@
+SRCDIR = ../src
+LIBPPM = -lppm
+
+include $(SRCDIR)/GNUmakefile
diff --git a/2003/i/buzz/mips/GNUmakefile b/2003/i/buzz/mips/GNUmakefile
new file mode 100644
index 0000000..785831d
--- /dev/null
+++ b/2003/i/buzz/mips/GNUmakefile
@@ -0,0 +1,4 @@
+SRCDIR = ../src
+LIBPPM = -lnetpbm
+
+include $(SRCDIR)/GNUmakefile
diff --git a/2003/i/buzz/src/GNUmakefile b/2003/i/buzz/src/GNUmakefile
index 49d861d..81442eb 100644
--- a/2003/i/buzz/src/GNUmakefile
+++ b/2003/i/buzz/src/GNUmakefile
@@ -1,7 +1,39 @@
-SUBDIRS = busp camera erreur kernel vision
+SUBDIRS = automate busp camera erreur vision
+TARGETS =
+CXXFLAGS = -Wall -g
+CPPFLAGS = -I. -I$(SRCDIR) -I/usr/pkg/include
+LDFLAGS = -L/usr/pkg/lib
+
+SRCDIR ?= .
+LIBPPM ?= -lppm
+LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
+
+VPATH = $(SUBDIRS:%=$(SRCDIR)/%)
+
+all: alltargets
+
+include $(SUBDIRS:%=$(SRCDIR)/%/Makefile.defs)
+
+alltargets: $(TARGETS)
+
+%.cc %.hh: %.yy
+ bison -o$(<F:%.yy=%.cc) --defines=$(<F:%.yy=%.h) $<
+
+%.cc: %.ll
+ flex -o$@ $<
+
+.dep/%.d: %.cc .dep
+ set -e; $(CXX) -M $(CPPFLAGS) $< \
+ | sed 's/\($*\)\.o[ :]*/\1.o .dep\/$*.d : /g' > $@; \
+ [ -s $@ ] || rm -f $@
+
+-include $(foreach target, $(TARGETS), $($(filter %.cc, $(target)_SOURCES):%.cc=.dep/%.d))
+
+.dep:
+ mkdir .dep
+
clean:
- for i in $(SUBDIRS); \
- do $(MAKE) -C $$i clean; \
- done
+ rm -f $(TARGETS) $(extra_clean) *.o *.a
+ rm -rf .dep
diff --git a/2003/i/buzz/src/automate/GNUmakefile b/2003/i/buzz/src/automate/GNUmakefile
deleted file mode 100644
index 0f0e9b7..0000000
--- a/2003/i/buzz/src/automate/GNUmakefile
+++ /dev/null
@@ -1,30 +0,0 @@
-SRCDIR = ..
-CXXFLAGS = -Wall -g
-CPPFLAGS = -I$(SRCDIR)
-
-TARGETS = grafcet.a
-grafcet_a_SOURCES = grafcet.cc receptivite.cc action.cc grammar.tab.cc lexer.cc
-
-all: $(TARGETS)
-
-grammar.tab.cc grammar.tab.hh: grammar.yy
- bison $<
-
-lexer.cc: lexer.ll grammar.tab.hh
- flex -o$@ $<
-
-grafcet.a: ${grafcet_a_SOURCES:%.cc=grafcet.a(%.o)}
-
-.dep/%.d: %.cc .dep
- @set -e; $(CC) -M $(CPPFLAGS) $< \
- | sed 's/\($*\)\.o[ :]*/\1.o .dep\/$*.d : /g' > $@; \
- [ -s $@ ] || rm -f $@
-
--include $(grafcet_a_SOURCES:%.cc=.dep/%.d)
-
-.dep:
- @mkdir .dep
-
-clean:
- rm -f $(TARGETS) *.o
- rm -rf .dep
diff --git a/2003/i/buzz/src/automate/Makefile.defs b/2003/i/buzz/src/automate/Makefile.defs
new file mode 100644
index 0000000..ca0a7a9
--- /dev/null
+++ b/2003/i/buzz/src/automate/Makefile.defs
@@ -0,0 +1,5 @@
+automate_a_SOURCES = grafcet.cc receptivite.cc action.cc grammar.cc lexer.cc
+
+extra_clean += grammar.h grammar.cc lexer.cc
+
+automate.a: ${automate_a_SOURCES:%.cc=automate.a(%.o)}
diff --git a/2003/i/buzz/src/automate/lexer.ll b/2003/i/buzz/src/automate/lexer.ll
index 6760aee..9cf6c93 100644
--- a/2003/i/buzz/src/automate/lexer.ll
+++ b/2003/i/buzz/src/automate/lexer.ll
@@ -5,7 +5,7 @@ using namespace std;
#include "grafcet.h"
using namespace Automate;
-#include "grammar.tab.hh"
+#include "grammar.h"
int yyparse (void);
diff --git a/2003/i/buzz/src/busp/GNUmakefile b/2003/i/buzz/src/busp/GNUmakefile
deleted file mode 100644
index e575f30..0000000
--- a/2003/i/buzz/src/busp/GNUmakefile
+++ /dev/null
@@ -1,15 +0,0 @@
-SRCDIR = ..
-CXXFLAGS = -Wall -g
-CPPFLAGS = -I$(SRCDIR)
-
-TARGETS = test_busp
-test_busp_SOURCES = busp.cc busp_ir.cc busp_servo.cc test_busp.cc \
- $(SRCDIR)/erreur/erreur.a
-
-all: $(TARGETS)
-
-test_busp: $(test_busp_SOURCES:%.cc=%.o)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDADD)
-
-clean:
- rm -f $(TARGETS) *.o
diff --git a/2003/i/buzz/src/busp/Makefile.defs b/2003/i/buzz/src/busp/Makefile.defs
new file mode 100644
index 0000000..4e2d12c
--- /dev/null
+++ b/2003/i/buzz/src/busp/Makefile.defs
@@ -0,0 +1,4 @@
+TARGETS += test_busp
+test_busp_SOURCES = busp.cc busp_ir.cc busp_servo.cc test_busp.cc erreur.a
+
+test_busp: $(test_busp_SOURCES:%.cc=%.o)
diff --git a/2003/i/buzz/src/camera/GNUmakefile b/2003/i/buzz/src/camera/GNUmakefile
deleted file mode 100644
index 56aaef9..0000000
--- a/2003/i/buzz/src/camera/GNUmakefile
+++ /dev/null
@@ -1,16 +0,0 @@
-SRCDIR = ..
-CXXFLAGS = -Wall -g
-CPPFLAGS = -I$(SRCDIR) -I/usr/pkg/include
-LDFLAGS = -L/usr/pkg/lib
-LDADD = -lnetpbm
-
-TARGETS = test_camera
-test_camera_SOURCES = camera.cc test_camera.cc $(SRCDIR)/vision/vision.a $(SRCDIR)/erreur/erreur.a
-
-all: $(TARGETS)
-
-test_camera: $(test_camera_SOURCES:%.cc=%.o)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDADD)
-
-clean:
- rm -f $(TARGETS) *.o
diff --git a/2003/i/buzz/src/camera/Makefile.defs b/2003/i/buzz/src/camera/Makefile.defs
new file mode 100644
index 0000000..060aaaa
--- /dev/null
+++ b/2003/i/buzz/src/camera/Makefile.defs
@@ -0,0 +1,7 @@
+TARGETS += test_camera
+test_camera_SOURCES = camera.cc test_camera.cc vision.a erreur.a -lppm
+camera_a_SOURCES = camera.cc
+
+test_camera: $(test_camera_SOURCES:%.cc=%.o)
+
+camera.a: ${camera_a_SOURCES:%.cc=camera.a(%.o)}
diff --git a/2003/i/buzz/src/erreur/GNUmakefile b/2003/i/buzz/src/erreur/GNUmakefile
deleted file mode 100644
index e888f79..0000000
--- a/2003/i/buzz/src/erreur/GNUmakefile
+++ /dev/null
@@ -1,13 +0,0 @@
-SRCDIR = ..
-CXXFLAGS = -Wall -g
-CPPFLAGS = -I$(SRCDIR)
-
-TARGETS = erreur.a
-erreur_a_SOURCES = erreur.cc
-
-all: $(TARGETS)
-
-erreur.a: $(erreur_a_SOURCES:%.cc=erreur.a(%.o))
-
-clean:
- rm -f $(TARGETS) *.o
diff --git a/2003/i/buzz/src/erreur/Makefile.defs b/2003/i/buzz/src/erreur/Makefile.defs
new file mode 100644
index 0000000..a76a201
--- /dev/null
+++ b/2003/i/buzz/src/erreur/Makefile.defs
@@ -0,0 +1,3 @@
+erreur_a_SOURCES = erreur.cc
+
+erreur.a: $(erreur_a_SOURCES:%.cc=erreur.a(%.o))
diff --git a/2003/i/buzz/src/vision/GNUmakefile b/2003/i/buzz/src/vision/GNUmakefile
deleted file mode 100644
index 6527e4e..0000000
--- a/2003/i/buzz/src/vision/GNUmakefile
+++ /dev/null
@@ -1,29 +0,0 @@
-SRCDIR = ..
-CXXFLAGS = -Wall -g
-CPPFLAGS = -I$(SRCDIR) -I/usr/pkg/include
-LDFLAGS = -L/usr/pkg/lib
-LDADD = -lnetpbm
-
-TARGETS = test_image vision.a
-test_image_SOURCES = test_image.cc image.cc thresholds.cc
-vision_a_SOURCES = image.cc thresholds.cc
-
-all: $(TARGETS)
-
-test_image: $(test_image_SOURCES:%.cc=%.o)
- $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDADD)
-
-vision.a: ${vision_a_SOURCES:%.cc=vision.a(%.o)}
-
-.dep/%.d: %.cc .dep
- @set -e; $(CC) -M $(CPPFLAGS) $< \
- | sed 's/\($*\)\.o[ :]*/\1.o .dep\/$*.d : /g' > $@; \
- [ -s $@ ] || rm -f $@
-
-include $(test_image_SOURCES:%.cc=.dep/%.d)
-
-.dep:
- @mkdir .dep
-
-clean:
- rm -f $(TARGETS) *.o
diff --git a/2003/i/buzz/src/vision/Makefile.defs b/2003/i/buzz/src/vision/Makefile.defs
new file mode 100644
index 0000000..d90037e
--- /dev/null
+++ b/2003/i/buzz/src/vision/Makefile.defs
@@ -0,0 +1,7 @@
+TARGETS += test_image
+test_image_SOURCES = test_image.cc image.cc thresholds.cc camera.a erreur.a -lppm
+vision_a_SOURCES = image.cc thresholds.cc
+
+test_image: $(test_image_SOURCES:%.cc=%.o)
+
+vision.a: ${vision_a_SOURCES:%.cc=vision.a(%.o)}