Add support to user lib in Makefile
This commit is contained in:
parent
9d46cd6d83
commit
fdf70a0e1d
|
@ -7,11 +7,11 @@ INCLUDES=-I$(ROOT)/emulation/
|
||||||
RM = rm -rf
|
RM = rm -rf
|
||||||
SRC=reduce-traditionnal.c data_gen.c
|
SRC=reduce-traditionnal.c data_gen.c
|
||||||
BIN=reduce-traditional data-gen reduce-ngi
|
BIN=reduce-traditional data-gen reduce-ngi
|
||||||
OBJ=libngi.so
|
OBJ=libngi.so libreduce-ngi-userlib.so
|
||||||
|
|
||||||
all: clean build test
|
all: clean build test
|
||||||
|
|
||||||
build: data-gen reduce-ngi reduce-traditional
|
build: $(BIN) $(OBJ)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(BIN) $(OBJ)
|
$(RM) $(BIN) $(OBJ)
|
||||||
|
@ -25,11 +25,14 @@ data-gen: data-gen.c
|
||||||
# Build NGI Emulation lib
|
# Build NGI Emulation lib
|
||||||
libngi.so: $(ROOT)/emulation/ngi.c
|
libngi.so: $(ROOT)/emulation/ngi.c
|
||||||
@echo 'Building ngi shared library: $@'
|
@echo 'Building ngi shared library: $@'
|
||||||
@echo $(ROOT)
|
$(CC) $(CLFAGS) $(INCLUDES) $< -shared -fpic -o $@
|
||||||
$(CC) $(CLFAFS) $(INCLUDES) $< -shared -fpic -o $@
|
|
||||||
|
libreduce-ngi-userlib.so: reduce-ngi-userlib.c
|
||||||
|
@echo 'Building ngi user shared library: $@'
|
||||||
|
gcc $(CFLAGS) -Wall -Wextra $< -shared -fpic -o $@
|
||||||
|
|
||||||
reduce-ngi: reduce-ngi.c libngi.so
|
reduce-ngi: reduce-ngi.c libngi.so
|
||||||
$(CC) $(CFLAGS) $< -o $@ $(INCLUDES) -L. -l ngi -Wl,-rpath=$(PWD)
|
$(CC) $(CFLAGS) $< -o $@ $(INCLUDES) -L. -l ngi -Wl,-rpath=$(PWD) -ldl
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@echo "Data generation"
|
@echo "Data generation"
|
||||||
|
|
Loading…
Reference in New Issue