Jump to content
  • Advertisement
Sign in to follow this  

Anyone using the Gnu build tools system?

This topic is 1991 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know a lot of people are using cmake now, but is anyone using autoconf, automake, libtool etc?

I'm using it, but I really don't understand it as well as I need to make changes in my projects server install process.  (client is Java, so it uses ANT)


You know software is using it if it comes with a



sudo make install

build process.

Share this post

Link to post
Share on other sites
Guest Hiwas

I use the autoconf stuff only for libraries which have no other build solutions.  So while I have some familiarity with the abilities, syntax and how they work I'm far from an expert.  The primary reason I have never dug into them is that they are virtually useless on Windows which is unfortunately still my primary working environment.  Using cygwin, msys etc to supply the tools is just not a very useful option when working in VC for most purposes.  So, when I run into libraries such as those, I usually wrap them with CMake to do the actual build and call the './configure' from CMake on the platforms where it is required.  For instance, GLog is my logging library of choice and on OsX/Linux it uses './configure', so I detect if the 'config.hpp' has been generated on those platforms, if not I call the './configure' to prepare the code but then compile the files through CMake, the reason being that I want the libraries embedded in my code and don't want to have to rely on pre-built versions which may have compiler flag differences and other such problems.


With all that said, if there is a specific problem you are having, ask away.  I'm not very good with those tools but can often muddle through figuring them out.. :)

Share this post

Link to post
Share on other sites

I have setup several GNU-based build systems primary via cygwin.

I don't see much of a need for autoconf or automake anymore. They are legacy tools designed to support a wide range of broken POSIX systems.

I presume targeting IRIX & HP-UX are not priorities for you.


GNU make v4.0 corrects a number of subtle defects in the way make has worked in the past and it can handle complex projects pretty easy now.

I make sub-makefiles to handle stuff I resuse over-and-over.


I have a program.mk that knows how to build the current directory as a program.

I break out the toolchains into their own sub-makefiles. I target embedded stuff so this will need a bit of work for it to make sense for PC toolchains.


This is an excerpt from my program.mk file

PROGRAM=$(strip $(notdir $(CURDIR)))

# Find the source
ifeq ($(SRC_DIRS),)
SRC_DIRS=src $(patsubst %/.,%,$(wilcard src/*/.))

ifeq ($(INC_DIRS),)

CC_SRCS=$(filter-out $(XSRC_LIST),$(foreach SRC_DIR,$(SRC_DIRS), $(wildcard $(SRC_DIR)/*.c)))
AS_SRCS=$(filter-out $(XSRC_LIST),$(foreach SRC_DIR,$(SRC_DIRS), $(wildcard $(SRC_DIR)/*.s)))

CC_OBJS=$(subst src/,obj/,$(patsubst %.c,%.o,$(CC_SRCS)))
AS_OBJS=$(subst src/,obj/,$(patsubst %.s,%.o,$(AS_SRCS)))
OBJ_DIRS=$(sort $(dir $(OBJS)))
DEPS=$(patsubst obj/%.o,dep/%.dep,$(OBJS))
DEP_DIRS=$(subst obj/,dep/,$(OBJ_DIRS))

# Compiler/Toolchain selection
ifeq ($(VENDOR),)
$(warning Vendor is not set, choose from VENDOR={demo, microsoft, gnu}
include ../../sweng/toolchain/demo.mk
include ../../sweng/toolchain/$(VENDOR)-$(ARCH).mk

@rm -rf out obj lst log lnt dep
@printf "Cleaned $(BRED)%s$(NORMAL)/$(BGREEN)%s$(NORMAL) $(OKSTRING)\n" "$(TARGET)" "$(PROGRAM)"

build: prep $(filter clean cleanall,$(MAKECMDGOALS)) @$(MAKE) --no-print-directory $(OUTPUTS) @printf "Built $(BRED)%s$(NORMAL)/$(BGREEN)%s$(NORMAL) $(OKSTRING)\n" "$(TARGET)" "$(PROGRAM)".PHONY: $(PHONY)
.PRECIOUS: $(PRECIOUS)vpath src/%.h $(INC_DIRS) vpath src/%.c $(SRC_DIRS) vpath src/%.s $(SRC_DIRS)

Getting dependencies working well took me a bit


# For some goals it is important that dependencies are not included
# For example, if a .dep has an error in it and a 'make clean' is issued the clean will fail

# If no goal is specified on the command line we default to 'build' so we need to include dependencies if
#  MAKECMDGOALS is blank!
INCDEP = build

# Only include dependency files that exist
ifneq ($(INCDEP),)
$(info Including dependencies)
DEPS_EXISTING = $(foreach DIR,$(DEP_DIRS),$(wildcard $(DIR)*.dep))
ifneq ($(DEPS_EXISTING),)
include $(DEPS_EXISTING)
endif #INCDEP
Edited by Shannon Barber

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!