From b57628e6519b5a031bbba970c70fb8c2ac204640 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 14 Oct 2011 03:17:19 +0200 Subject: replaced half autoconf build system with a simpler GNU make and Emake based one new build system adheres to common usage of make command line and environment variables --- Makefile | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a8a4c78..579b140 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,23 @@ +export CC ?= gcc +export ERL ?= erl +export RM ?= rm -DIRS = src c_src demo +CFLAGS ?= -O2 +CPPFLAGS ?= +LDFLAGS ?= -all clean: - @set -e ; \ - for d in $(DIRS) ; do \ - if [ -d $$d ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \ - done +override CFLAGS += -Wall -debug: - @set -e ; \ - for d in $(DIRS) ; do \ - if [ -d $$d ]; then ( cd $$d && $(MAKE) TYPE=debug ) || exit 1 ; fi ; \ - done +export CFLAGS CPPFLAGS LDFLAGS +all: + $(MAKE) -C c_src $@ + $(ERL) -noinput -eval \ + "case make:all() of up_to_date -> halt(0); error -> halt(1) end" +install: + $(MAKE) -C c_src $@ -# possibly with --with-slang-include arg -conf: - (cd config; ./configure) - - +clean: + $(MAKE) -C c_src $@ + $(RM) -f {ebin,demo}/*.beam -- cgit v1.2.3