Commit f8a33fc9 authored by Josh Kunz's avatar Josh Kunz

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

parent d08e03ee
...@@ -7,4 +7,3 @@ ...@@ -7,4 +7,3 @@
*.naga *.naga
Makefile.d Makefile.d
include/*
.PHONY: clean libs .PHONY: clean libs
libs = jsonm.cma uutf.cma http.cma libs = jsonm.cma uutf.cma http.cma
include_dir = ../../include include_dir = ../include
libs: $(libs) libs: $(libs)
%.cma: %/ $(include_dir):
mkdir $@
%.cma: %/ | $(include_dir)
$(MAKE) -C $< $@ $(MAKE) -C $< $@
$(MAKE) -C $< include="$(include_dir)/" includes $(MAKE) -C $< include="../$(include_dir)/" includes
cp $<$@ . cp $<$@ .
clean: clean:
......
...@@ -15,14 +15,20 @@ interfaces = $(yaccp).mli $(wildcard *.mli) ...@@ -15,14 +15,20 @@ interfaces = $(yaccp).mli $(wildcard *.mli)
sources = $(yaccp).ml $(lexp).ml sources = $(yaccp).ml $(lexp).ml
sources += HTTPTypes.ml HTTP.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)) objects = $(patsubst %.ml,%.cmo,$(sources))
depfile = Makefile.d depfile = Makefile.d
$(lib): $(objects) $(lib): $(objects)
includes: $(interfaces) includes: $(e_interfaces_)
cp $(interfaces) $(include) cp $^ $(include)
$(depfile): $(yaccp).mli $(yaccp).ml $(lexp).ml $(depfile): $(yaccp).mli $(yaccp).ml $(lexp).ml
$(depfile): $(sources) $(interfaces) $(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