Appledoc can't run in Xcode - ios

So I'm following this tutorial for the appledoc generation (http://objcsharp.wordpress.com/2013/09/24/how-to-generate-beautiful-apple-style-documentation-in-xcode-5/). Nothing happens after the build. Here's the script:
#if [ ${CONFIGURATION} == "Release" ]; then
APPLEDOC_PATH=`which appledoc`
if [ $APPLEDOC_PATH ]; then
$APPLEDOC_PATH \
--project-name ${PRODUCT_NAME} \
--project-company "Your Name" \
--company-id "com.yourcompany" \
--output ${PRODUCT_NAME}Docs \
--keep-undocumented-objects \
--keep-undocumented-members \
--keep-intermediate-files \
--no-repeat-first-par \
--no-warn-invalid-crossref \
--exit-threshold 2 \
${PROJECT_DIR}/${PRODUCT_NAME}
fi;
#fi;
To make sure I install the appledoc correctly, I did the following from the terminal and the doc shows up fine.
appledoc --project-name BabelCPP --project-company "My Name" --company-id com.mycompany --no-create-docset --output ./doc/ ./CaterpillarCount/CaterpillarCount
Am I missing any critical step or setup in Xcode? It seems like the following part didn't execute correctly and it's what terminate this run script:
APPLEDOC_PATH=`which appledoc`
if [ $APPLEDOC_PATH ]; then
$APPLEDOC_PATH \

The default path on OSX is /usr/bin:/bin:/usr/sbin:/sbin, and if you followed the instructions, you would have copied it to /usr/local/bin.
XCode won't consider changes that you've put into your .bash_profile files, etc, so anything that's launched from it will not have a path (this includes the run script you've posted).
You can add PATH=$PATH:/usr/local/bin on the line prior to the APPLEDOC_PATH=... line, which should allow it to be found.
Secondly, you need to have a proper test:
if [ -n "$APPLEDOC_PATH" -a -x "$APPLEDOC_PATH" ]; then
i.e. test that the variable is set, and that the file is executable that it determines.
so, altogether:
PATH=$PATH:/usr/local/bin
APPLEDOC_PATH=`which appledoc`
if [ -n "$APPLEDOC_PATH" -a -x "$APPLEDOC_PATH" ]; then

Related

how to make docker keep running in frontend and not exit so that I could see the running log output

Now I want to make a docker command run in frontend so that I could see the log output. Now I am using this command to run my docker container:
docker run -p 11110:11110 -p 11111:11111 -p 11112:11112 --name canal-server dolphinjiang/canal-server:v1.1.5
this is the Dockerfile of my project:
FROM centos:7
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo ZONE=\"Asia/Shanghai\" > /etc/sysconfig/clock
RUN rm -rf /etc/yum.repos.d/*.repo
COPY CentOS6-Base-163.repo /etc/yum.repos.d/
RUN yum clean all
RUN groupadd -g 2500 canal; useradd -u 2501 -g canal -d /home/canal -m canal
RUN echo canal:De#2018er | chpasswd; echo root:dockerroot | chpasswd
RUN yum -y update && yum -y install wget vi openssl.x86_64 glibc.x86_64 tar tar.x86_64 inetutils-ping net-tools telnet which file
RUN yum clean all
COPY jdk-8u291-linux-x64.tar.gz /opt
RUN tar -zvxf /opt/jdk-8u291-linux-x64.tar.gz -C /opt && \
rm -rf /opt/jdk-8u291-linux-x64.tar.gz && \
chmod -R 755 /opt/jdk1.8.0_291 && \
chown -R root:root /opt/jdk1.8.0_291
RUN echo 'export JAVA_HOME=/opt/jdk1.8.0_291' >> /etc/profile
RUN echo 'export JRE_HOME=$JAVA_HOME/jre' >> /etc/profile
RUN echo 'export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH' >> /etc/profile
RUN echo 'export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH' >> /etc/profile
RUN source /etc/profile
RUN yum install kde-l10n-Chinese -y
RUN yum install glibc-common -y
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
ENV JAVA_HOME /opt/jdk1.8.0_291
ENV PATH $PATH:$JAVA_HOME/bin
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
ADD canal-server /home/canal/
RUN chmod 755 /home/canal/bin
WORKDIR /home/canal/bin
RUN chmod 777 /home/canal/bin/restart.sh
RUN chmod 777 /home/canal/bin/startup.sh
RUN chmod 777 /home/canal/bin/stop.sh
RUN chmod 777 /home/canal/bin/config.sh
CMD /home/canal/bin/config.sh
this is the config.sh:
cat > /home/canal/conf/canal.properties <<- EOF
# register ip
canal.register.ip = ${HOSTNAME}.canal-server-discovery-svc-stable.testcanal.svc.cluster.local
# canal admin config
canal.admin.manager = canal-admin-stable:8089
canal.admin.port = 11110
canal.admin.user = admin
canal.admin.passwd = 4ACFE3202A5FF5CF467898FC58AAB1D615029441
# admin auto register
canal.admin.register.auto = true
canal.admin.register.cluster =
EOF
sh /home/canal/bin/restart.sh
and this is the restart.sh:
#!/bin/bash
args=$#
case $(uname) in
Linux)
bin_abs_path=$(readlink -f $(dirname $0))
;;
*)
bin_abs_path=$(cd $(dirname $0) ||exit ; pwd)
;;
esac
sh "$bin_abs_path"/stop.sh $args
sh "$bin_abs_path"/startup.sh $args
and this is the start.sh:
#!/bin/bash
current_path=`pwd`
case "`uname`" in
Linux)
bin_abs_path=$(readlink -f $(dirname $0))
;;
*)
bin_abs_path=`cd $(dirname $0); pwd`
;;
esac
base=${bin_abs_path}/..
canal_conf=$base/conf/canal.properties
canal_local_conf=$base/conf/canal_local.properties
logback_configurationFile=$base/conf/logback.xml
export LANG=en_US.UTF-8
export BASE=$base
if [ -f $base/bin/canal.pid ] ; then
echo "found canal.pid , Please run stop.sh first ,then startup.sh" 2>&2
exit 1
fi
if [ ! -d $base/logs/canal ] ; then
mkdir -p $base/logs/canal
fi
## set java path
if [ -z "$JAVA" ] ; then
JAVA=$(which java)
fi
ALIBABA_JAVA="/usr/alibaba/java/bin/java"
TAOBAO_JAVA="/opt/taobao/java/bin/java"
if [ -z "$JAVA" ]; then
if [ -f $ALIBABA_JAVA ] ; then
JAVA=$ALIBABA_JAVA
elif [ -f $TAOBAO_JAVA ] ; then
JAVA=$TAOBAO_JAVA
else
echo "Cannot find a Java JDK. Please set either set JAVA or put java (>=1.5) in your PATH." 2>&2
exit 1
fi
fi
case "$#"
in
0 )
;;
1 )
var=$*
if [ "$var" = "local" ]; then
canal_conf=$canal_local_conf
else
if [ -f $var ] ; then
canal_conf=$var
else
echo "THE PARAMETER IS NOT CORRECT.PLEASE CHECK AGAIN."
exit
fi
fi;;
2 )
var=$1
if [ "$var" = "local" ]; then
canal_conf=$canal_local_conf
else
if [ -f $var ] ; then
canal_conf=$var
else
if [ "$1" = "debug" ]; then
DEBUG_PORT=$2
DEBUG_SUSPEND="n"
JAVA_DEBUG_OPT="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=$DEBUG_SUSPEND"
fi
fi
fi;;
* )
echo "THE PARAMETERS MUST BE TWO OR LESS.PLEASE CHECK AGAIN."
exit;;
esac
str=`file -L $JAVA | grep 64-bit`
if [ -n "$str" ]; then
JAVA_OPTS="-server -Xms2048m -Xmx3072m -Xmn1024m -XX:SurvivorRatio=2 -XX:PermSize=96m -XX:MaxPermSize=256m -Xss256k -XX:-UseAdaptiveSizePolicy -XX:MaxTenuringThreshold=15 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError"
else
JAVA_OPTS="-server -Xms1024m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:MaxPermSize=128m "
fi
JAVA_OPTS=" $JAVA_OPTS -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8"
CANAL_OPTS="-DappName=otter-canal -Dlogback.configurationFile=$logback_configurationFile -Dcanal.conf=$canal_conf"
if [ -e $canal_conf -a -e $logback_configurationFile ]
then
for i in $base/lib/*;
do CLASSPATH=$i:"$CLASSPATH";
done
CLASSPATH="$base/conf:$CLASSPATH";
echo "cd to $bin_abs_path for workaround relative path"
cd $bin_abs_path
echo LOG CONFIGURATION : $logback_configurationFile
echo canal conf : $canal_conf
echo CLASSPATH :$CLASSPATH
$JAVA $JAVA_OPTS $JAVA_DEBUG_OPT $CANAL_OPTS -classpath .:$CLASSPATH com.alibaba.otter.canal.deployer.CanalLauncher 2>&1
echo $! > $base/bin/canal.pid
echo "cd to $current_path for continue"
cd $current_path
else
echo "canal conf("$canal_conf") OR log configration file($logback_configurationFile) is not exist,please create then first!"
fi
after I start the docker, it exit automaticlly, and the docker not startup, no log output. what should I do to make it run in frontend. after successs, switch to the backend. I also tried to run in deamon like this(make the container run background and not exit):
docker run -it -d -p 11110:11110 -p 11111:11111 -p 11112:11112 --name canal-server canal/canal-server:v1.1.5
the process still exit automaticlly. and docker container did not startup.
Basically, you should get the point (based on your latest comment).
Docker is based on some command, when it's done - it stops the container.
So to make it continuously running you should have command and run infinitely.
Also check this answer as well, there are more explanation
Why docker exiting with code 0
One of the easiest solution is to tail some logs.
Like,
tail -f /dev/null
Taken from here
you can use tail -f /dev/null to keep the container from stopping, try this
docker run -it -d -p 11110:11110 -p 11111:11111 -p 11112:11112 --name canal-server canal/canal-server:v1.1.5 tail -f /dev/null
see also this post

Lex compilation error of IOS example of opencascade library in Xcode

I'm trying to build an IOS example of OPENCascade library on MacOs. Xcode version were used: 10.2, 10, 3, 11.1. RIght now I'm getting the following types of errors:
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:60: bad character: =
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:60: bad character: =
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:60: bad character: =
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:60: bad character: =
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:60: bad character: =
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:60: bad character: =
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:60: bad character: =
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:60: bad character: =
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:62: name defined twice
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:63: bad character: {
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:65: bad character: }
../occt_lib/src/BRepFeat/BRepFeat_MakeCylindricalHole.lxx:66: premature EOF
flex: error deleting output file ../project.build/DerivedSources/BRepFeat_MakeCylindricalHole.yy.cxx
Command ../XcodeDefault.xctoolchain/usr/bin/lex failed with exit code 1
Possible reasons in my opinion:
1) I don't have all of the files in the project (I've checked it, so it shouldn't be a reason)
2) Xcode doesn't treat .lxx files in a proper way.
Within OCCT file name conversions, .lxx is an extension for inline C++ header files, included by co-named .hxx header files. BRepFeat package has no any .yacc/.lex files, thus BRepFeat_MakeCylindricalHole.yy.cxx should not exist at all.
It looks like the issue is somewhere within building routine (CMake or Tcl script) generating XCode project / Makefile. It is unclear from question if an issue happens on building OCCT itself (and which steps have been taken) or while building iOS sample (is it the one coming with OCCT or written from scratch?).
CMake build for OCCT can be configured via the following cross-compilation toolchain and pseudo bash script:
https://github.com/leetal/ios-cmake
export IPHONEOS_DEPLOYMENT_TARGET=8.0
aFreeType=$HOME/freetype-2.7.1-ios
cmake -G "Unix Makefiles" \
-D CMAKE_TOOLCHAIN_FILE:FILEPATH="$HOME/ios-cmake.git/ios.toolchain.cmake" \
-D PLATFORM:STRING="OS64" \
-D ARCHS:STRING="arm64" \
-D IOS_DEPLOYMENT_TARGET:STRING="$IPHONEOS_DEPLOYMENT_TARGET" \
-D ENABLE_VISIBILITY:BOOL="TRUE" \
-D CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL="OFF" \
-D CMAKE_BUILD_TYPE:STRING="Release" \
-D BUILD_LIBRARY_TYPE:STRING="Static" \
-D INSTALL_DIR:PATH="work/occt-ios-install" \
-D INSTALL_DIR_INCLUDE:STRING="inc" \
-D INSTALL_DIR_LIB:STRING="lib" \
-D INSTALL_DIR_RESOURCE:STRING="src" \
-D INSTALL_NAME_DIR:STRING="#executable_path/../Frameworks" \
-D 3RDPARTY_FREETYPE_DIR:PATH="$aFreeType" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_INCLUDE_DIR_ft2build:FILEPATH="$aFreeType/include" \
-D 3RDPARTY_FREETYPE_LIBRARY_DIR:PATH="$aFreeType/lib" \
-D USE_FREEIMAGE:BOOL="OFF" \
-D BUILD_MODULE_Draw:BOOL="OFF" \
"/Path/To/OcctSourceCode"
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
make -j $aNbJobs
make install

make dep: Nothing to be done for 'depend'

I have been trying to compile the PJSIP library for an iOS project which needs SIP. Following this tutorial, I have been able to run the configure-iphone script. The next step would to run the make dep for the dependencies, but sadly it fails bcs of some error, unknown to me. I have also tried to edit the makefile, so it points directly to the file, but I still get the error, so it can find the file.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Samples.mak depend
make[2]: Nothing to be done for `depend'.
is the error I get.
The make file:
include ../../build.mak
include $(PJDIR)/build/common.mak
export LIBDIR := ../lib
export BINDIR := ../bin
RULES_MAK := $(PJDIR)/build/rules.mak
SAMPLES_MAK := $(PJDIR)/pjsip-apps/build/Samples.mak
###############################################################################
# Gather all flags.
#
export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
$(PJ_CFLAGS) $(CFLAGS) $(CC_INC)../../pjsip/include \
$(CC_INC)../../pjlib/include \
$(CC_INC)../../pjlib-util/include \
$(CC_INC)../../pjnath/include \
$(CC_INC)../../pjmedia/include
export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
$(HOST_CXXFLAGS) $(CXXFLAGS)
export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
$(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS)
###############################################################################
# Defines for building PJSUA
#
export PJSUA_SRCDIR = ../src/pjsua
export PJSUA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
main.o pjsua_app.o pjsua_app_cli.o pjsua_app_common.o \
pjsua_app_config.o pjsua_app_legacy.o
export PJSUA_CFLAGS += $(PJ_CFLAGS) $(CFLAGS)
export PJSUA_CXXFLAGS += $(PJ_CXXFLAGS) $(CFLAGS)
export PJSUA_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
export PJSUA_EXE:=pjsua-$(TARGET_NAME)$(HOST_EXE)
###############################################################################
# Defines for building pjsystest
#
export PJSYSTEST_SRCDIR = ../src/pjsystest
export PJSYSTEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
systest.o main_console.o
export PJSYSTEST_CFLAGS += $(PJ_CFLAGS) $(CFLAGS)
export PJSYSTEST_CXXFLAGS += $(PJ_CXXFLAGS) $(CFLAGS)
export PJSYSTEST_LDFLAGS += $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
export PJSYSTEST_EXE:=pjsystest-$(TARGET_NAME)$(HOST_EXE)
export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT
TARGETS := $(PJSUA_EXE) $(PJSYSTEST_EXE) samples
all: $(TARGETS)
swig:
$(MAKE) -C ../src/swig
doc:
dep: depend
distclean: realclean
.PHONY: all dep depend clean realclean distclean
.PHONY: $(TARGETS)
.PHONY: $(PJSUA_EXE) $(PJSYSTEST_EXE)
pjsua: $(PJSUA_EXE)
$(PJSUA_EXE):
$(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(subst /,$(HOST_PSEP),$(BINDIR)/$#)
#if echo "$(TARGET_NAME)" | grep -q "apple-darwin_ios$$"; then \
for F in $(filter %$(TARGET_NAME).a,$(PJ_LIBXX_FILES)); do \
if test -f $$F; then \
tmp=`echo $${F##*/} | sed -e "s/\-$(TARGET_NAME)\.a/.a/"`; \
ln -sf $$F ../src/pjsua/ios/$$tmp; \
fi; \
done; \
fi;
pjsystest: $(PJSYSTEST_EXE)
$(PJSYSTEST_EXE):
$(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $(subst /,$(HOST_PSEP),$(BINDIR)/$#)
samples:
$(MAKE) -f $(SAMPLES_MAK)
.PHONY: pjsua.ko
pjsua.ko:
$(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(subst /,$(HOST_PSEP),$(LIBDIR)/$#)
clean depend realclean:
$(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $#
$(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $#
#Problem happens in the next row!
$(MAKE) -f $(SAMPLES_MAK) $#
#if test "$#" = "depend"; then \
echo '$(BINDIR)/$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \
echo '$(BINDIR)/$(PJSYSTEST_EXE): $(APP_LIB_FILES)' >> .pjsystest-$(TARGET_NAME).depend; \
fi
#if echo "$(TARGET_NAME)" | grep -q "apple-darwin_ios$$"; then \
for F in $(filter %$(TARGET_NAME).a,$(PJ_LIBXX_FILES)); do \
tmp=`echo $${F##*/} | sed -e "s/\-$(TARGET_NAME)\.a/.a/"`; \
rm -f ../src/pjsua/ios/$$tmp; \
done; \
fi;
Like I said, I added the SAMPLES_MAK variable, but sadly it didn't help. I also found out which line is giving me the error, it's close to the end of the file $(MAKE) -f $(SAMPLES_MAK) $#.
Use official documentation for building. It works 100% for all current architectures for iOS.
Usually this means you've accidentally (?) created a file or directory named depend in your working directory. So, make sees that file or directory and, since the makefile doesn't list any prerequisites of the depend target, it believe the target is up to date.
This is why generally you declare these types of helper targets to be .PHONY, but apparently that makefile doesn't do this.

Minix 3.2.1 Makefile issue

I'm trying to run make with the below Makefile and I get the following error Makefile:2: *** missing separator. Stop.. This Makefile is the original file from Minix 3.2.1. I haven't done any changes. I check from the tabs problem. Can someone help me?
Thanks.
# Makefile for the kernel image.
.include <bsd.own.mk>
.include "nbsd.config"
.include <bsd.own.mk>
.include <bsd.sys.mk>
u=/usr
MDEC= /usr/mdec
GEN_FILES= *.bak image kernel *.iso *.iso.gz cdfdimage rootimage src
# LSC detect where were built the objects files
PROGROOT:= ..
.if "${MAKEOBJDIR:S,${.CURDIR},,}" != ""
PROGROOT:= ${MAKEOBJDIR:S,releasetools,,}
.endif
# Specify the programs that are part of the system image.
KERNEL= ${PROGROOT}/kernel/kernel
# PROGRAMS are in the order they should be loaded by boot
PROGRAMS+= ${PROGROOT}/servers/ds/ds
PROGRAMS+= ${PROGROOT}/servers/rs/rs
PROGRAMS+= ${PROGROOT}/servers/pm/pm
PROGRAMS+= ${PROGROOT}/servers/sched/sched
PROGRAMS+= ${PROGROOT}/servers/vfs/vfs
PROGRAMS+= ${PROGROOT}/drivers/memory/memory
.if ${MACHINE_ARCH} == "i386"
PROGRAMS+= ${PROGROOT}/drivers/log/log
.endif
PROGRAMS+= ${PROGROOT}/drivers/tty/tty
PROGRAMS+= ${PROGROOT}/servers/mfs/mfs
PROGRAMS+= ${PROGROOT}/servers/vm/vm
PROGRAMS+= ${PROGROOT}/servers/pfs/pfs
PROGRAMS+= ${PROGROOT}/servers/init/init
usage:
#echo " " >&2
#echo "Master Makefile to create new MINIX configuration." >& 2
#echo "Root privileges are required." >&2
#echo " " >&2
#echo "Usage:" >&2
#echo " make includes # Install include files" >&2
#echo " make depend # Generate dependency files" >&2
#echo " make services # Compile and install all services" >&2
#echo " make install # Make image, and install to hard disk" >&2
#echo " make hdboot # Make image, and install to hard disk" >&2
#echo " make bootable # Make hard disk bootable" >&2
#echo " make nbsd_fetch # Download current NetBSD reference sources" >&2
#echo " make nbsd_diff # Update minix-port.patch in NetBSD sources" >&2
#echo " make clean # Remove all compiler results, except libs" >&2
#echo " " >&2
#echo "To create a fresh MINIX configuration, try:" >&2
#echo " make clean install # new boot image" >&2
#echo " make fresh install # new everything" >&2
#echo " " >&2
all: services
# rebuild the program or system libraries
includes:
$(MAKE) -C ../ includes
depend: includes .gitignore
$(MAKE) -C ../ depend
.gitignore: Makefile
echo $(GEN_FILES) | tr ' ' '\n' >.gitignore
services: includes kernel servers .WAIT drivers
kernel: includes
$(MAKE) -C ../kernel
servers: includes
$(MAKE) -C ../servers all install
drivers: includes servers
$(MAKE) -C ../drivers all install
# make bootable and place system images
bootable:
exec su root mkboot bootable ${DESTDIR}
hdboot: services .WAIT do-hdboot
do-hdboot:
#rm -rf ${DESTDIR}/boot/minix/.temp/
${INSTALL_DIR} ${DESTDIR}/boot/minix/.temp
# mod_0 is used to make alphabetical order equal to the boot order
#n=0; \
for i in ${PROGRAMS}; \
do \
n=`expr $$n + 1`; \
[ "$$n" -ge 10 ] && prefix="mod" || prefix="mod0"; \
newname="${DESTDIR}/boot/minix/.temp/$${prefix}$${n}_`basename $$i`"; \
${INSTALL} $$i $$newname; \
done
#cp ${PROGROOT}/kernel/kernel ${DESTDIR}/boot/minix/.temp/
#if [ "${MKINSTALLBOOT:Uno}" != "no" ] ; then \
${STRIP} -s ${DESTDIR}/boot/minix/.temp/* ; \
gzip ${DESTDIR}/boot/minix/.temp/mod* ; \
${HOST_SH} mkboot hdboot ${DESTDIR}; \
${HOST_SH} ../commands/update_bootcfg/update_bootcfg.sh;\
else \
${INSTALL_DIR} ${DESTDIR}/multiboot; \
${INSTALL} ${DESTDIR}/boot/minix/.temp/* ${DESTDIR}/multiboot; \
fi
install:
${MAKE} includes services hdboot
# download and update NetBSD reference sources.
nbsd_fetch:
export CVS_RSH=ssh; \
export OLDPWD=`pwd`; \
echo "retrieving hierarchies from ${NBSD_CVSROOT}"; \
IFS=,; \
cd ..; \
cat releasetools/nbsd_ports | grep -v '^#' | while read port ; \
do set $$port; \
date=$$1; minixpath=$$2; origpath=$$3; \
if [ $$# -lt 3 ]; then origpath=$$2; fi; \
echo "retrieving $$origpath .."; \
cvs -q -d ${NBSD_CVSROOT} co -N -D "$$date UTC" -d nbsdsrc "src/$$origpath" ; \
done; \
cd $${OLDPWD};
nbsd_diff:
find .. -name minix-port.patch | xargs rm
cat nbsd_ports | grep -v '^#' | \
( cd .. && awk -F, '{ minixpath=$$2; origpath=$$3; if(NF < 3) { origpath=$$2; } system("sh releasetools/nbsd_diff.sh " \
"nbsdsrc/src/"origpath" "minixpath" "minixpath"/minix-port.patch");}' )
find .. -name minix-port.patch | xargs wc -l | sort -n
# clean up compile results
clean:
$(MAKE) -C ../kernel $#
$(MAKE) -C ../servers $#
$(MAKE) -C ../drivers $#
rm -rf $(GEN_FILES)
cleandepend::
$(MAKE) -C ../kernel $#
$(MAKE) -C ../servers $#
$(MAKE) -C ../drivers $#
MINIX uses BSD make, which typically uses . to prefix its specific extensions. You installed GNU make, which has another set of extensions, not prefixed with .; furthermore you put GNU make ahead in the PATH order without renaming it. This is not going to take off.
What we usually do is to name GNU make under the name gmake or gnumake, and invoke it under that name when needed (for example, to compile packages from GNU ecosystem, or with a strong Linux bias.)
Another possibility you might consider is to install (if not already done) the bmake package, and uses that command when trying to compile programs which expect the BSD breed of make (this includes MINIX itself.)

Makefile foreach inside if

I'm trying to run a foreach function that only should run when a condition is fulfilled.
The foreach function works fine when I delete the surrounding if. When I write my makefile like the followring, the foreach loop stops working before the first command is executed and the build process never ends (I don't think that I built an infinite loop, because none of the commands inside is executed).
if [ $(BUILD_SPEC) = mySpec ]; \
then ( \
if [ ! -d $(PRJ_ROOT_DIR)/TARGET ]; then mkdir $(PRJ_ROOT_DIR)/TARGET; fi; \
$(foreach target,$(basename $(PROJECT_TARGETS)), \
if [ -e $(PRJ_ROOT_DIR)/$(BUILD_SPEC)/$(target).crc ]; \
then ( \
echo Deleting $(PRJ_ROOT_DIR)/$(BUILD_SPEC)/$(target).crc; \
rm -f $(PRJ_ROOT_DIR)/$(BUILD_SPEC)/$(target).crc; \
) \
fi; \
) \
) \
fi;
I solved this by my own:
For some reason the command "if [ $(BUILD_SPEC) = mySpec ];" does not work. I replaced it by "ifeq ($(BUILD_SPEC),mySpec)". Now the Script works the way I wanted it to.

Resources