Makefile path directory using ~/

Olivier

I am trying to compile a test through a make file. Why does the first path with ~/ not compile, while the second with the full path work. ARen't they the equivalent? Should I avoid using ~/ in makefiles?

This did not compile:

g++ -isystem ~/workspace/gtest-1.7.0/include -I~/workspace/gtest-1.7.0 -g -Wall -Wextra -pthread -c \ ~/workspace/gtest-1.7.0/src/gtest-all.cc /home/olivier/workspace/gtest-1.7.0/src/gtest-all.cc:42:24: fatal

error: src/gtest.cc: No such file or directory #include "src/gtest.cc"

This compiled fine:

g++ -isystem /home/olivier/workspace/gtest-1.7.0/include -I/home/olivier/workspace/gtest-1.7.0 -g -Wall -Wextra -pthread -c \ /home/olivier/workspace/gtest-1.7.0/src/gtest-all.cc

Dan

~ expansion doesn't generally work in the middle of a string. The shell that Make is using doesn't know what to do with -I~/whatever. Try relative paths instead, or if you absolutely need an equivalent of ~, try $(HOME).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Specifying path to "makefile" using "make" command

From Dev

How to compile multiple separate C files in a directory using a Makefile?

From Dev

with glfw -3.2.1 inside my work directory ,how to compile with it using makefile

From Dev

How to find the path of webapps directory using java

From Dev

Is there a way to find directory path using regex on cmake?

From Dev

How to find the path of webapps directory using java

From Dev

specify directory or path using slash or dot slash

From Dev

Bash path variable using ~ resulting in 'No such file or directory'

From Dev

Using sed to Replace Environment Variable with directory path

From Dev

IIS path issue when using virtual directory

From Dev

Copying found directory to path built using specified argument and found directory

From Dev

Picking a particular directory path using os path in Python

From Dev

Current working directory of makefile

From Dev

Invoking the Makefile of parent directory

From Dev

Makefile directory creation for subdirectories

From Dev

Directory independent target in Makefile

From Dev

Makefile remaking directory target

From Dev

Directory independent target in Makefile

From Dev

Makefile directory creation for subdirectories

From Dev

Makefile header directory errors

From Dev

Makefile - no such file or directory error

From Dev

Makefile with directory for object files

From Dev

display image by using selected field as the source path/directory using php

From Dev

Problems setting PATH in Makefile

From Dev

change PATH in makefile

From Dev

Path dependency in Makefile

From Dev

Using the directory path returned from QTFile Dialogue in Python Code

From Dev

Not able to save the file in custom path directory using Python Telegram bot

From Dev

Why is using the '-execdir' action insecure for directory which is in the PATH?

Related Related

  1. 1

    Specifying path to "makefile" using "make" command

  2. 2

    How to compile multiple separate C files in a directory using a Makefile?

  3. 3

    with glfw -3.2.1 inside my work directory ,how to compile with it using makefile

  4. 4

    How to find the path of webapps directory using java

  5. 5

    Is there a way to find directory path using regex on cmake?

  6. 6

    How to find the path of webapps directory using java

  7. 7

    specify directory or path using slash or dot slash

  8. 8

    Bash path variable using ~ resulting in 'No such file or directory'

  9. 9

    Using sed to Replace Environment Variable with directory path

  10. 10

    IIS path issue when using virtual directory

  11. 11

    Copying found directory to path built using specified argument and found directory

  12. 12

    Picking a particular directory path using os path in Python

  13. 13

    Current working directory of makefile

  14. 14

    Invoking the Makefile of parent directory

  15. 15

    Makefile directory creation for subdirectories

  16. 16

    Directory independent target in Makefile

  17. 17

    Makefile remaking directory target

  18. 18

    Directory independent target in Makefile

  19. 19

    Makefile directory creation for subdirectories

  20. 20

    Makefile header directory errors

  21. 21

    Makefile - no such file or directory error

  22. 22

    Makefile with directory for object files

  23. 23

    display image by using selected field as the source path/directory using php

  24. 24

    Problems setting PATH in Makefile

  25. 25

    change PATH in makefile

  26. 26

    Path dependency in Makefile

  27. 27

    Using the directory path returned from QTFile Dialogue in Python Code

  28. 28

    Not able to save the file in custom path directory using Python Telegram bot

  29. 29

    Why is using the '-execdir' action insecure for directory which is in the PATH?

HotTag

Archive