summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to '2003/i/buzz/src/GNUmakefile')
-rw-r--r--2003/i/buzz/src/GNUmakefile40
1 files changed, 36 insertions, 4 deletions
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