Thread: Minor issue pulling from gitlab

  1. #1
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,310

    Minor issue pulling from gitlab

    Got this:
    Code:
    make chkpaw --no-print-directory
    make -f run.mak chkpaw
    git -C ./cloned/mak pull --verbose
    POST git-upload-pack (155 bytes)
    From https://gitlab.com/awsdert/mak
     = [up to date]      master     -> origin/master
    run.mak:6: *** missing separator.  Stop.
    make: *** [GNUmakefile:9: chkpaw] Error 2
    Compilation failed.
    From this:
    Code:
    include dir.mak
    
    pull_mak:=git -C $(MAK_DIR) pull --verbose
    
    $(info $(pull_mak))
    $(shell $(pull_mak))
    I'm not seeing the error, I know this is technically unrelated to C but I figured my fellow members here have had similar experience in this problem, any ideas?

    For reference dir.mak looks like this:
    Code:
    TOP_DIR?=.
    BIN_DIR?=$(TOP_DIR)/bin
    LIB_DIR?=$(TOP_DIR)/lib
    SRC_DIR?=$(TOP_DIR)/src
    OBJ_DIR?=$(TOP_DIR)/obj
    INC_DIR?=$(TOP_DIR)/include
    CLONED_DIR?=$(TOP_DIR)/cloned
    MAK_DIR?=$(CLONED_DIR)/mak
    
    ALL_DIR:=$(BIN_DIR) $(LIB_DIR) $(SRC_DIR) $(OBJ_DIR) $(INC_DIR) $(CLONED_DIR)
    
    directories: $(ALL_DIR:%=%/) $(MAK_DIR)/
    
    %/:
    	mkdir
    
    $(MAK_DIR)/:
    	git -C $(CLONED_DIR) clone https://gitlab.com/awsdert/mak.git
    
    .PHONY: directories

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,323
    If I remember correctly, a common reason for that error is the makefile being indented by spaces instead of tabs.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,310
    Quote Originally Posted by laserlight View Post
    If I remember correctly, a common reason for that error is the makefile being indented by spaces instead of tabs.
    Nope, that's definitely not it, just went checking and did not find a single space where there should be a tab, didn't expect to find any anyways as I prefer tabs to spaces, any other ideas?

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,323
    Shouldn't lines 5 and 6 go in a rule or whatever they call it?

    EDIT:
    Oh, looks like line 5 doesn't have to go in a rule, but it makes sense to keep it with line 6.
    Last edited by laserlight; 04-21-2021 at 04:04 AM.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,310
    Never mind, finally thought "Ah! maybe that's..." and did this instead:
    Code:
    include dir.mak
    
    pull_mak:=git -C $(MAK_DIR) pull
    
    $(info $(pull_mak))
    $(info $(shell $(pull_mak)))
    shell was returning output and make was treating that output as part of the make script

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    4,037
    On windows, I would guess spaces in the path and try changing

    Code:
    git -C $(CLONED_DIR) clone https://gitlab.com/awsdert/mak.git
    to
    Code:
    git -C "$(CLONED_DIR)" clone https://gitlab.com/awsdert/mak.git
    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  7. #7
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,310
    Quote Originally Posted by laserlight View Post
    Shouldn't lines 5 and 6 go in a rule or whatever they call it?

    EDIT:
    Oh, looks like line 5 doesn't have to go in a rule, but it makes sense to keep it with line 6.
    Just seen your comment, I'm assuming you were talking about the shell command right?

  8. #8
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,310
    Quote Originally Posted by stahta01 View Post
    On windows, I would guess spaces in the path and try changing

    Code:
    git -C $(CLONED_DIR) clone https://gitlab.com/awsdert/mak.git
    to
    Code:
    git -C "$(CLONED_DIR)" clone https://gitlab.com/awsdert/mak.git
    Tim S.
    I don't use spaces in directory names, not really sure how to go about putting in the quotes for automatic variables though, all I can think of is this:
    Code:
    $(^:%="%")
    Either way it turned out that wasn't the problem

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,323
    Quote Originally Posted by awsdert
    shell was returning output and make was treating that output as part of the make script
    info is normally used to print some info rather than to actually do something though. Wouldn't it be simpler to just write say:
    Code:
    all:
        $(pull_mak)
    EDIT:
    Although I guess naming the target "pull" rather than "all" would make more sense. But then if you really want to always pull, then maybe your approach is okay? It seems strange to me though, since presumably there may be things you want to do with make that doesn't involve pulling from a git repo.
    Last edited by laserlight; 04-21-2021 at 04:28 AM.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #10
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,310
    Quote Originally Posted by laserlight View Post
    info is normally used to print some info rather than to actually do something though. Wouldn't it be simpler to just write say:
    Code:
    all:
        $(pull_mak)
    EDIT:
    Although I guess naming the target "pull" rather than "all" would make more sense. But then if you really want to always pull, then maybe your approach is okay? It seems strange to me though, since presumably there may be things you want to do with make that doesn't involve pulling from a git repo.
    This particular project that I'm pulling is where I'm starting to store all the makefile functions and per system/compiler variables plus the auto mappes variables, so in this case yeah an always pull is needed before they get used to ensure any improvements or additional mappings are used. It's also the same method I prefer to apply to any 3rd party project, at least the code will be current then

  11. #11
    Registered User
    Join Date
    May 2012
    Location
    Arizona, USA
    Posts
    778
    Quote Originally Posted by awsdert View Post
    Do you expect us to be phsycic? How are we to know what the "..." means?
    That comment looks like a copy-paste of (some parts of) The difference between forking and cloning a repository.

  12. #12
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    1,310
    Quote Originally Posted by christop View Post
    That comment looks like a copy-paste of (some parts of) The difference between forking and cloning a repository.
    Oh wow, one of us was psychic, thx btw

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pulling my hair out!
    By paraplayer in forum C++ Programming
    Replies: 4
    Last Post: 09-14-2005, 10:18 PM
  2. pulling numbers from files....
    By Confuzz in forum C++ Programming
    Replies: 3
    Last Post: 09-07-2004, 07:49 PM
  3. Minor Visual C++ 6.0 Compiler Issue(s)
    By Xei in forum Tech Board
    Replies: 7
    Last Post: 06-30-2003, 12:45 PM
  4. Pulling an all-nighter
    By Maverik in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 04-24-2003, 10:50 AM
  5. pulling strings
    By ... in forum C++ Programming
    Replies: 4
    Last Post: 03-13-2002, 07:31 PM

Tags for this Thread