Commit f8a33fc9 authored by Josh Kunz's avatar Josh Kunz

lib/Makefile now generate the 'include' directory automatically.

parent d08e03ee
......@@ -7,4 +7,3 @@
*.naga
Makefile.d
include/*
.PHONY: clean libs
libs = jsonm.cma uutf.cma http.cma
include_dir = ../../include
include_dir = ../include
libs: $(libs)
%.cma: %/
$(include_dir):
mkdir $@
%.cma: %/ | $(include_dir)
$(MAKE) -C $< $@
$(MAKE) -C $< include="$(include_dir)/" includes
$(MAKE) -C $< include="../$(include_dir)/" includes
cp $<$@ .
clean:
......
......@@ -15,14 +15,20 @@ interfaces = $(yaccp).mli $(wildcard *.mli)
sources = $(yaccp).ml $(lexp).ml
sources += HTTPTypes.ml HTTP.ml
HTTP.cmi: HTTP.cmo
# Modules with external interfaces
e_interfaces = HTTP.ml
e_interfaces_ = $(patsubst %.ml,%.cmi,$(filter %.ml,$(e_interfaces)))
e_interfaces_ += $(patsubst %.mli,%.cmi,$(filter %.mli,$(e_interfaces)))
objects = $(patsubst %.ml,%.cmo,$(sources))
depfile = Makefile.d
$(lib): $(objects)
includes: $(interfaces)
cp $(interfaces) $(include)
includes: $(e_interfaces_)
cp $^ $(include)
$(depfile): $(yaccp).mli $(yaccp).ml $(lexp).ml
$(depfile): $(sources) $(interfaces)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment