Makefiles

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • t4nk
    Swordsman
    • May 2016
    • 336

    Makefiles

    So, Nick wanted a working Makefile.std...

    First, what to do with autoconf.h? Is this the only header autoconf produces? I think a makefile shouldn't require autoconf.h (otherwise, why even bother). Presumably, all these macros (DEFAULT_CONFIG_PATH, HAVE_DIRENT_H, etc) should be defined in the makefile?

    Second, "make depgen" is a pretty old school way to calculate dependencies, how about a more automated way? I used a pretty fancy (IMO ) method for textui2 (https://github.com/takkaria/angband/...kefile.dep.ui2). I don't think it can break Makefile.osx and Makefile.win (if I change it to work only on BASEOBJS, like Makefile.inc does), but it might be just too fancy/obscure. Another option is to just copy "depend" stuff from buildsys.mk.
    Anyway, I have never seen this method used by anyone else, so wanted to brag

    Third - just curious - does Makefile.nmake even work? I think it shouldn't, we've already determined Angband can't be compiled with MSVC++. Curious about Makefile.nds too. At least this one looks like it might work...

    So i guess I'm asking about autoconf.h... Is it the only thing that makes angband's binary dependent on configure?
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9647

    #2
    I think so?

    I guess the intent here is for Makefile.std to be a thing that anyone building on a *nix system (including probably command line for Macs) can use with a decent chance of it working, even if it isn't as convenient as the regular build system. So you should do what you think best. If your fancy system works well, go ahead and use it - it would be a shame to let it go to waste, after all
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • takkaria
      Veteran
      • Apr 2007
      • 1951

      #3
      Yeah I think it's a neater way to do it. The current method dates back many years now, when I think it was required for compatibility with, I don't know, maybe FreeBSD?

      Also, Angband's binary shouldn't be reliant on autoconf.h... it never used to be and I don't think there's any code-level changes that make it so. Including autoconf.h should be guarded by #ifdef USE_AUTOCONF or whatever.
      takkaria whispers something about options. -more-

      Comment

      • Pete Mack
        Prophet
        • Apr 2007
        • 6883

        #4
        Yeah, the only reason to have autoconf is to include angband in linux distros and packages. It is a mysterious mechanism* that most people wouldn't want to touch. Makefile.std is much cleaner and should be easier to maintain.


        * I believe that is a Steamband flavor

        Comment

        • t4nk
          Swordsman
          • May 2016
          • 336

          #5
          Finally! I've had some time to work on it. If anyone wants to test...
          GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

          Works for me It's a makefile, though, chances are you'll need to edit linker and compiler flags.
          I won't send a pull request just yet, I suspect it can still be improved*... Time to do some work on SDL2 port, this is more fun than writing makefiles anyway

          * like, say, adding main-test.o? Forgot about it, although it doesn't seem all that useful...
          Also main-stats.c. Hmm, I don't think anyone will actually use the makefile for that?
          Last edited by t4nk; February 6, 2019, 00:01.

          Comment

          • t4nk
            Swordsman
            • May 2016
            • 336

            #6
            Originally posted by takkaria
            Also, Angband's binary shouldn't be reliant on autoconf.h... it never used to be and I don't think there's any code-level changes that make it so.
            Indeed it doesn't! I thought without stuff like HAVE_DIRENT_H it wouldn't work (at least, not properly) but it works.

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎