makefile

makefile with dependency on a shared library sub project

我怕爱的太早我们不能终老 提交于 2021-02-11 12:38:10
问题 So I have a makefile. I'll just put a pseudo example for the moment just enough so that I can talk about the issue and keep it simple... Let's say I have in my makefile something like this: # Rule to build my test executable - with dependency on the library mytest build: libmytest.so g++ test.cpp -lmytest.so # Rule to build mytest library libmytest.so: g++ mytestlib.cpp -fPIC ... etc ... cc -fPIC -Wl,-soname,libmytest.so ... etc... So, if/when I change the file mytestlib.cpp , I see that

How to configure Shebang line of internal Python Tools

蹲街弑〆低调 提交于 2021-02-11 12:20:42
问题 I am trying to build a minimal docker image, capable of nothing more but running the Python interpreter. During development I start from alpine, the final image will be build FROM scratch . I am working on a Linux Mint machine. I am able to compile the Python compiler and install it into my current working directory like this: cd Python-3.8.7 ./configure --prefix=$PWD/../python make install However, I did not find out how to tweak the --prefix settings correctly so that the created shebangs

ScalaZ3 installation issue

牧云@^-^@ 提交于 2021-02-11 07:01:47
问题 I am trying to install ScalaZ3 by using the site https://github.com/epfl-lara/ScalaZ3 . I cloned the code into my directory on Windows, opened a Linux terminal and ran sbt +package . At first it returned several errors since I am using Ubuntu Linux subsystem on Windows, so I had to comment out some lines in mk_util.py to make it work. I now encounter another problem where it is trying to run a "make" file but it can't find it. It has the correct directory path and the file exists in that

ScalaZ3 installation issue

我怕爱的太早我们不能终老 提交于 2021-02-11 07:01:32
问题 I am trying to install ScalaZ3 by using the site https://github.com/epfl-lara/ScalaZ3 . I cloned the code into my directory on Windows, opened a Linux terminal and ran sbt +package . At first it returned several errors since I am using Ubuntu Linux subsystem on Windows, so I had to comment out some lines in mk_util.py to make it work. I now encounter another problem where it is trying to run a "make" file but it can't find it. It has the correct directory path and the file exists in that

Error while compiling through cygwin

家住魔仙堡 提交于 2021-02-11 05:13:03
问题 I am using cygwin for 64 bit Windows but while compiling a makefile I end up with this error /bin/sh: -c: line 0: syntax error near unexpected token `(' What should I do ? 回答1: Just guessing: you use bashisms in your Makefile, but don't set the shell ( /bin/sh reports the error). Just state SHELL := /bin/bash at the top of the Makefile. 来源: https://stackoverflow.com/questions/31851661/error-while-compiling-through-cygwin

makefile error: make: *** No rule to make target `omp.h' ; with OpenMP

旧巷老猫 提交于 2021-02-10 19:52:44
问题 all, I was compiling a C program with OpenMP. It's my first time to use makefile. When excuting "make", the gcc reports the error make: * No rule to make target omp.h', needed by smooth.o'. Stop. However the omp.h is in the /usr/lib/gcc/i686-linux-gnu/4.6/include/omp.h , I am wondering how to fix it. Could anyone help me? Thank you. CC=gcc CFLAGS = -fopenmp all: smooth smooth: smooth.o ompsooth.o $(CC) $(CFLAGS) -o smooth smooth.o ompsmooth.o ompsmooth.o: ompsmooth.c assert.h stdio.h stdlib.h

Right way to use VPATH/vpath?

随声附和 提交于 2021-02-10 16:20:30
问题 I am trying to use my Makefile (Make for Windows) by adding source paths to vpath/VPATH. This seems trivial but for some reason I am unable to get it to work My directory structure is like this: ├── Makefile ├── out\ └── src\ └── hello.cpp My Makefile is: TGT=out OBJ=hello.o VPATH=src # vpath %.cpp src all: $(TGT)\app.exe $(TGT)\app : $(TGT)\$(OBJ) g++ $^ -o $@ $(TGT)\%.o : %.cpp g++ -Wall -Wextra -Werror -c $< changing to vpath didn't help me. I seem to have something fundamentally wrong

Undefined reference after using CMAKE to generate a makefile

北慕城南 提交于 2021-02-10 06:11:07
问题 I can generate my CMake project, but I can't build it. I have a fairly straightforward project structure: ├── bin ├── build ├── CMakeLists.txt ├── include │ └── project │ ├── base_socket.h │ ├── tcp_client.h │ ├── tcp_server.h │ ├── udp_client.h │ └── udp_server.h ├── LICENSE.txt ├── README.md └── src └── project ├── base_socket.cpp ├── CMakeLists.txt ├── main.cpp ├── tcp_client.cpp ├── tcp_server.cpp ├── udp_client.cpp └── udp_server.cpp And a fairly straight forward CMakeLists.txt file in

Undefined reference after using CMAKE to generate a makefile

此生再无相见时 提交于 2021-02-10 06:08:57
问题 I can generate my CMake project, but I can't build it. I have a fairly straightforward project structure: ├── bin ├── build ├── CMakeLists.txt ├── include │ └── project │ ├── base_socket.h │ ├── tcp_client.h │ ├── tcp_server.h │ ├── udp_client.h │ └── udp_server.h ├── LICENSE.txt ├── README.md └── src └── project ├── base_socket.cpp ├── CMakeLists.txt ├── main.cpp ├── tcp_client.cpp ├── tcp_server.cpp ├── udp_client.cpp └── udp_server.cpp And a fairly straight forward CMakeLists.txt file in

How to use bash regex inside Makefile Target

对着背影说爱祢 提交于 2021-02-09 17:42:55
问题 In a bash script, the following regex appears to work well: MY_STRING="FirstName-LastName-Gender-Age" MY_REGEX="([^-]+)-([^-]+)$" if [[ $MY_STRING =~ $MY_REGEX ]]; then echo "Match: $BASH_REMATCH" fi I'm interested in using this script inside the Makefile. It appears to have syntax issues. For example: my-target: MY_STRING="FirstName-LastName-Gender-Age" MY_REGEX="([^-]+)-([^-]+)$" if [[ $MY_STRING =~ $MY_REGEX ]]; then echo "Match: $BASH_REMATCH" fi What would be the correct syntax for this