77 lines
1.6 KiB
Makefile
77 lines
1.6 KiB
Makefile
#
|
|
# Makefile for the linux ncp-filesystem routines.
|
|
#
|
|
|
|
CC = gcc
|
|
|
|
ifeq ($(HAVE_ELF),yes)
|
|
PIC_FLAG = -fPIC
|
|
NCP_LIB = libncp.so.1.0
|
|
LIB_LINK_COMMAND = gcc -shared -Wl,-soname,libncp.so.1 -o $(NCP_LIB)
|
|
INSTALL_LIB = install $(NCP_LIB) -m 755 /lib; \
|
|
ln -sf $(NCP_LIB) /lib/libncp.so.1; \
|
|
ldconfig
|
|
export PIC_FLAG
|
|
else
|
|
NCP_LIB = libncp.a
|
|
LIB_LINK_COMMAND = ar r libncp.a
|
|
endif
|
|
|
|
CFLAGS += $(PIC_FLAG)
|
|
|
|
default:
|
|
make -C ..
|
|
|
|
all: libcom_err.a ncplib_err.o $(NCP_LIB)
|
|
|
|
install:
|
|
$(INSTALL_LIB)
|
|
|
|
ncplib.o: ncplib.c ncplib_err.h
|
|
$(CC) $(CFLAGS) -c ncplib.c
|
|
|
|
COM_ERR_CFILES = com_err/com_err.c com_err/error_message.c com_err/et_name.c \
|
|
com_err/init_et.c
|
|
COM_ERR_OFILES = com_err/com_err.o com_err/error_message.o com_err/et_name.o \
|
|
com_err/init_et.o
|
|
|
|
libcom_err.a: $(COM_ERR_CFILES)
|
|
make -C com_err
|
|
|
|
$(NCP_LIB): ncplib.o ncplib_err.o libcom_err.a
|
|
$(LIB_LINK_COMMAND) ncplib.o ncplib_err.o $(COM_ERR_OFILES)
|
|
ln -sf libncp.so.1.0 libncp.so.1
|
|
ln -sf libncp.so.1 libncp.so
|
|
export LD_LIBRARY_PATH=`pwd`:LD_LIBRARY_PATH
|
|
|
|
ncplib_err.o: ncplib_err.h ncplib_err.c
|
|
$(CC) $(CFLAGS) -c ncplib_err.c
|
|
|
|
ncplib_err.h: ncplib_err.et
|
|
com_err/compile_et ncplib_err
|
|
ln -sf ../lib/ncplib_err.h ../include/ncplib_err.h
|
|
|
|
ncplib_err.c: ncplib_err.et
|
|
com_err/compile_et ncplib_err
|
|
|
|
dep: ncplib_err.h
|
|
make -C com_err dep
|
|
$(CPP) -M $(INCLUDES) *.c > .depend
|
|
|
|
clean:
|
|
make -C com_err clean
|
|
rm -f *.o *~ ncplib_err.[ch] ../include/ncplib_err.h
|
|
rm -f libncp.*
|
|
|
|
mrproper: clean
|
|
make -C com_err mrproper
|
|
rm -f $(UTILS) .depend $(DISTFILE)
|
|
|
|
#
|
|
# include a dependency file if one exists
|
|
#
|
|
ifeq (.depend,$(wildcard .depend))
|
|
include .depend
|
|
endif
|
|
|