# HG changeset patch # User Mychaela Falconia # Date 1702444572 0 # Node ID 3d6cfb615d90000b2b6125c80a354fdbaebb21f0 # Parent 05a94b08c8e12c3b0003ef40a6e4229bd92b90b6 add make install hierarchy diff -r 05a94b08c8e1 -r 3d6cfb615d90 Makefile --- a/Makefile Wed Dec 13 03:56:16 2023 +0000 +++ b/Makefile Wed Dec 13 05:16:12 2023 +0000 @@ -1,4 +1,6 @@ -SUBDIR= libnumdb libnumutil utils +SUBDIR= include libnumdb libnumutil utils + +INSTALL_PREFIX= /opt/themwi all: ${SUBDIR} @@ -7,6 +9,11 @@ ${SUBDIR}: FRC cd $@; ${MAKE} ${MFLAGS} +install: FRC + mkdir -p ${INSTALL_PREFIX} + for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} \ + INSTALL_PREFIX=${INSTALL_PREFIX} install); done + clean: FRC rm -f a.out core errs for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done diff -r 05a94b08c8e1 -r 3d6cfb615d90 include/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/Makefile Wed Dec 13 05:16:12 2023 +0000 @@ -0,0 +1,12 @@ +INSTALL_PREFIX= /opt/themwi + +INSTDIR=${INSTALL_PREFIX}/include/themwi/nanp +FILES= number_db_v2.h number_lookup.h number_utils.h + +all: + +install: + mkdir -p ${INSTDIR} + install -c -m 644 ${FILES} ${INSTDIR} + +clean: diff -r 05a94b08c8e1 -r 3d6cfb615d90 libnumdb/Makefile --- a/libnumdb/Makefile Wed Dec 13 03:56:16 2023 +0000 +++ b/libnumdb/Makefile Wed Dec 13 05:16:12 2023 +0000 @@ -1,7 +1,10 @@ +INSTALL_PREFIX= /opt/themwi + CC= gcc CFLAGS= -O2 -I../build-inc OBJS= check_nanp.o check_short.o readbin.o refresh.o LIB= libnumdb.a +INSTDIR=${INSTALL_PREFIX}/lib all: ${LIB} @@ -9,5 +12,9 @@ ar rcu $@ ${OBJS} ranlib $@ +install: + mkdir -p ${INSTDIR} + install -c -m 644 ${LIB} ${INSTDIR} + clean: rm -f *.[oa] errs diff -r 05a94b08c8e1 -r 3d6cfb615d90 libnumutil/Makefile --- a/libnumutil/Makefile Wed Dec 13 03:56:16 2023 +0000 +++ b/libnumutil/Makefile Wed Dec 13 05:16:12 2023 +0000 @@ -1,7 +1,10 @@ +INSTALL_PREFIX= /opt/themwi + CC= gcc CFLAGS= -O2 -I../build-inc OBJS= digit_groups.o nanp_valid.o numstring.o LIB= libnumutil.a +INSTDIR=${INSTALL_PREFIX}/lib all: ${LIB} @@ -9,5 +12,9 @@ ar rcu $@ ${OBJS} ranlib $@ +install: + mkdir -p ${INSTDIR} + install -c -m 644 ${LIB} ${INSTDIR} + clean: rm -f *.[oa] errs diff -r 05a94b08c8e1 -r 3d6cfb615d90 utils/Makefile --- a/utils/Makefile Wed Dec 13 03:56:16 2023 +0000 +++ b/utils/Makefile Wed Dec 13 05:16:12 2023 +0000 @@ -1,8 +1,11 @@ +INSTALL_PREFIX= /opt/themwi + CC= gcc CFLAGS= -O2 -I../build-inc PROGS= themwi-check-own themwi-dump-numdb themwi-short-dial themwi-update-numdb LIBNUMDB=../libnumdb/libnumdb.a LIBUTIL=../libnumutil/libnumutil.a +INSTBIN=${INSTALL_PREFIX}/bin all: ${PROGS} @@ -18,5 +21,9 @@ themwi-update-numdb: themwi-update-numdb.o ${LIBUTIL} ${CC} -o $@ $@.o ${LIBUTIL} +install: + mkdir -p ${INSTBIN} + install -c -m 755 ${PROGS} ${INSTBIN} + clean: rm -f *.o ${PROGS} errs