BIN = x1_n_alg
CC =aarch64-linux-gnu-gcc
TOPDIR = $(shell pwd)
SRCDIRS := $(TOPDIR)/src
INCLUDES := -I$(TOPDIR)/include
CFLAG = -fPIC -g -Wall -Os -Wno-unknown-pragmas -Wno-format
LIBS := -L. -L./lib/ -lNE10 -lm
OBJECTS := $(foreach ele, $(SRCDIRS), $(shell cd $(ele); ls *.c| sed "s:^:$(ele)/:" |sed "s:\.c:\.o:") )
export CC := $(CC)
export INCLUDES := $(INCLUDES)
export CFLAG := $(CFLAG)
all: $(BIN)
.PHONY: all
$(BIN) : $(OBJECTS)
$(CC) -o $@ $(OBJECTS) $(LIBS)
$(CC) -shared -o libx1_n_alg.so $(OBJECTS) $(LIBS)
/%.o:
cd $(dir $@); $(MAKE)
clean:
rm -f $(shell pwd)/$(BIN)
$(foreach ele, $(SRCDIRS), $(shell cd $(ele); $(MAKE) clean) )