diff options
author | Uros Majstorovic <majstor@majstor.org> | 2022-01-31 22:22:19 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2022-01-31 22:22:19 +0100 |
commit | 76be7c9a79da62e0a52d932bdfdf56671c82e33d (patch) | |
tree | 6385d50acb932766a11ded22901f1b333eb9856d /ecp | |
parent | 6594778ab99958c3efb7325e4203bb4e593fc1a6 (diff) |
build fix
Diffstat (limited to 'ecp')
-rwxr-xr-x | ecp/build.sh | 24 | ||||
-rw-r--r-- | ecp/platform/common.mk | 3 | ||||
-rw-r--r-- | ecp/platform/fe310.mk | 7 | ||||
-rw-r--r-- | ecp/platform/fe310/Makefile | 3 | ||||
-rw-r--r-- | ecp/platform/fe310/platform.mk | 3 | ||||
-rw-r--r-- | ecp/platform/fe310/platform_obj.mk (renamed from ecp/platform/fe310_obj.mk) | 0 | ||||
-rw-r--r-- | ecp/platform/posix/Makefile | 3 | ||||
-rw-r--r-- | ecp/platform/posix/platform.mk (renamed from ecp/platform/posix.mk) | 2 | ||||
-rw-r--r-- | ecp/platform/posix/platform_obj.mk (renamed from ecp/platform/posix_obj.mk) | 0 | ||||
-rw-r--r-- | ecp/src/Makefile | 23 | ||||
-rw-r--r-- | ecp/src/common.mk | 9 | ||||
-rw-r--r-- | ecp/src/htable/Makefile | 4 | ||||
-rw-r--r-- | ecp/src/vconn/Makefile | 3 | ||||
-rw-r--r-- | ecp/test/Makefile | 7 | ||||
-rw-r--r-- | ecp/util/Makefile | 6 |
15 files changed, 53 insertions, 44 deletions
diff --git a/ecp/build.sh b/ecp/build.sh index 7669db1..4b7a16f 100755 --- a/ecp/build.sh +++ b/ecp/build.sh @@ -5,20 +5,24 @@ if [ -z $1 ]; then else ARG=$1 fi +PLATFORM=posix cd src -make clean -if [ $ARG == "all" ]; then - make || exit - make install +if [ "$ARG" != "clean" ]; then + make platform=$PLATFORM clean fi +make platform=$PLATFORM $ARG || exit +if [ "$ARG" == "all" ]; then + make platform=$PLATFORM install +fi + cd ../util -make clean -if [ $ARG == "all" ]; then - make || exit +if [ "$ARG" != "clean" ]; then + make platform=$PLATFORM clean fi +make platform=$PLATFORM $ARG || exit cd ../test -make clean -if [ $ARG == "all" ]; then - make +if [ "$ARG" != "clean" ]; then + make platform=$PLATFORM clean fi +make platform=$PLATFORM $ARG || exit diff --git a/ecp/platform/common.mk b/ecp/platform/common.mk new file mode 100644 index 0000000..d49792b --- /dev/null +++ b/ecp/platform/common.mk @@ -0,0 +1,3 @@ +platform ?= posix +src_dir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../src) +include $(src_dir)/common.mk diff --git a/ecp/platform/fe310.mk b/ecp/platform/fe310.mk deleted file mode 100644 index fd3e6dd..0000000 --- a/ecp/platform/fe310.mk +++ /dev/null @@ -1,7 +0,0 @@ -FE310_HOME ?= $(PWD)/../../fw/fe310 -export FE310_HOME - -include $(FE310_HOME)/common.mk -CFLAGS += -I$(FE310_HOME) -DECP_WITH_VCONN=1 -DECP_DEBUG=1 -D__FE310__ - -platform = fe310 diff --git a/ecp/platform/fe310/Makefile b/ecp/platform/fe310/Makefile index 340effa..1a3502a 100644 --- a/ecp/platform/fe310/Makefile +++ b/ecp/platform/fe310/Makefile @@ -1,5 +1,4 @@ -include ../fe310.mk -CFLAGS += -I../../src +include ../common.mk obj_tr = transport.o obj_tm = time.o diff --git a/ecp/platform/fe310/platform.mk b/ecp/platform/fe310/platform.mk new file mode 100644 index 0000000..0230f29 --- /dev/null +++ b/ecp/platform/fe310/platform.mk @@ -0,0 +1,3 @@ +fe310_dir = $(abspath $(src_dir)/../../fw/fe310) +include $(fe310_dir)/platform.mk +CFLAGS += -I$(fe310_dir) -DECP_WITH_VCONN=1 -DECP_DEBUG=1 -D__FE310__ diff --git a/ecp/platform/fe310_obj.mk b/ecp/platform/fe310/platform_obj.mk index 52e4bb1..52e4bb1 100644 --- a/ecp/platform/fe310_obj.mk +++ b/ecp/platform/fe310/platform_obj.mk diff --git a/ecp/platform/posix/Makefile b/ecp/platform/posix/Makefile index aebb994..1a3502a 100644 --- a/ecp/platform/posix/Makefile +++ b/ecp/platform/posix/Makefile @@ -1,5 +1,4 @@ -include ../posix.mk -CFLAGS += -I../../src +include ../common.mk obj_tr = transport.o obj_tm = time.o diff --git a/ecp/platform/posix.mk b/ecp/platform/posix/platform.mk index 7e7daeb..0370c58 100644 --- a/ecp/platform/posix.mk +++ b/ecp/platform/posix/platform.mk @@ -1,4 +1,2 @@ CFLAGS += -O3 -DECP_WITH_PTHREAD=1 -DECP_WITH_HTABLE=1 -DECP_WITH_RBUF=1 -DECP_WITH_MSGQ=1 -DECP_WITH_VCONN=1 -DECP_WITH_DIRSRV -DECP_DEBUG=1 LDFLAGS += -lm -pthread - -platform = posix diff --git a/ecp/platform/posix_obj.mk b/ecp/platform/posix/platform_obj.mk index 6ca3b8d..6ca3b8d 100644 --- a/ecp/platform/posix_obj.mk +++ b/ecp/platform/posix/platform_obj.mk diff --git a/ecp/src/Makefile b/ecp/src/Makefile index 120fcbc..5fed12a 100644 --- a/ecp/src/Makefile +++ b/ecp/src/Makefile @@ -1,10 +1,11 @@ -include platform.mk -CFLAGS += -I. +include common.mk obj = core.o timer.o dir.o dir_srv.o -subdirs = crypto ../platform/$(platform) +subdirs = crypto $(platform_dir) +build_dir = ../build-$(platform) + +include $(platform_dir)/platform_obj.mk -include ../platform/$(platform)_obj.mk %.o: %.c $(CC) $(CFLAGS) -c $< @@ -19,16 +20,16 @@ all: $(obj) done install: all - mkdir -p build-$(platform)/ - install libecp.a build-$(platform)/ - install crypto/libecpcr.a build-$(platform)/ - install ../platform/$(platform)/libecptm.a build-$(platform)/ - install ../platform/$(platform)/libecptr.a build-$(platform)/ + mkdir -p $(build_dir) + install libecp.a $(build_dir) + install crypto/libecpcr.a $(build_dir) + install $(platform_dir)/libecptm.a $(build_dir) + install $(platform_dir)/libecptr.a $(build_dir) if [ -f htable/libecpht.a ]; then \ - install htable/libecpht.a build-$(platform)/; \ + install htable/libecpht.a $(build_dir); \ fi if [ -f vconn/libecpvconn.a ]; then \ - install vconn/libecpvconn.a build-$(platform)/; \ + install vconn/libecpvconn.a $(build_dir); \ fi clean: diff --git a/ecp/src/common.mk b/ecp/src/common.mk new file mode 100644 index 0000000..a2f8663 --- /dev/null +++ b/ecp/src/common.mk @@ -0,0 +1,9 @@ +platform ?= posix + +pwd := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))) +ecp_dir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))/..) +src_dir := $(abspath $(ecp_dir)/src) +platform_dir = $(abspath $(ecp_dir)/platform/$(platform)) + +include $(platform_dir)/platform.mk +CFLAGS += -I$(src_dir) -I$(platform_dir) diff --git a/ecp/src/htable/Makefile b/ecp/src/htable/Makefile index 76a4efd..854af5e 100644 --- a/ecp/src/htable/Makefile +++ b/ecp/src/htable/Makefile @@ -1,5 +1,5 @@ -include ../platform.mk -CFLAGS += -I.. -std=gnu89 +include ../common.mk +CFLAGS += -std=gnu89 obj = htable.o hashtable.o hashtable_itr.o diff --git a/ecp/src/vconn/Makefile b/ecp/src/vconn/Makefile index 459d16b..17962c4 100644 --- a/ecp/src/vconn/Makefile +++ b/ecp/src/vconn/Makefile @@ -1,5 +1,4 @@ -include ../platform.mk -CFLAGS += -I.. +include ../common.mk obj = vconn.o diff --git a/ecp/test/Makefile b/ecp/test/Makefile index 29fc020..5aeb57a 100644 --- a/ecp/test/Makefile +++ b/ecp/test/Makefile @@ -1,7 +1,8 @@ -include ../platform/posix.mk -CFLAGS += -I../src -I../util -Wno-int-to-void-pointer-cast +src_dir = ../src +include $(src_dir)/common.mk +CFLAGS += -I../util -Wno-int-to-void-pointer-cast -dep=../src/build-posix/*.a ../util/libecputil.a +dep=../build-posix/*.a ../util/libecputil.a %.o: %.c $(CC) $(CFLAGS) -c $< diff --git a/ecp/util/Makefile b/ecp/util/Makefile index 58d5086..72b6290 100644 --- a/ecp/util/Makefile +++ b/ecp/util/Makefile @@ -1,8 +1,8 @@ -include ../platform/posix.mk -CFLAGS += -I../src +src_dir = ../src +include $(src_dir)/common.mk obj=util.o -dep=../src/build-posix/*.a ./libecputil.a +dep=../build-posix/*.a ./libecputil.a %.o: %.c %.h |