Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 881367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:14:54+00:00 2026-05-15T12:14:54+00:00

I am running Windows 7 with gcc/g++ under Cygwin. What would be the Makefile

  • 0

I am running Windows 7 with gcc/g++ under Cygwin. What would be the Makefile format (and extension, I think it’s .mk?) for compiling a set of .cpp (C++ source) and .h (header) files into a static library (.dll). Say I have a variable set of files:

  • file1.cpp
  • file1.h

  • file2.cpp

  • file2.h

  • file3.cpp

  • file3.h

  • ….

What would be the makefile format (and extension) for compiling these into a static library? (I’m very new to makefiles) What would be the fastest way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:14:54+00:00Added an answer on May 15, 2026 at 12:14 pm

    The extension would be none at all, and the file is called Makefile (or makefile) if you want GNU Make to find it automatically.

    GNU Make, at least, lets you rely on certain automatic variables that alone give you control over much of the building process with C/C++ files as input. These variables include CC, CPP, CFLAGS, CPPFLAGS, CXX, CXXFLAGS, and LDFLAGS. These control the switches to the C/C++ preprocessor, compiler, and the linker (the program that in the end assembles your program) that make will use.

    GNU Make also includes a lot of implicit rules designed to enable it automatically build programs from C/C++ source code, so you don’t [always] have to write your own rules.

    For instance, even without a makefile, if you try to run make foobar, GNU Make will attempt to first build foobar.o from foobar.c or foobar.cpp if it finds either, by invoking appropriate compiler, and then will attempt to build foobar by assembling (incl. linking) its parts from system libraries and foobar.o. In short, GNU Make knows how to build the foobar program even without a makefile being present — thanks to implicit rules. You can see these rules by invoking make with the -p switch.

    Some people like to rely on GNU Make’s implicit rule database to have lean and short makefiles where only that specific to their project is specified, while some people may go as far as to disable the entire implicit rule database (using the -r switch) and have full control of the building process by specifying everything in their makefile(s). I won’t comment on superiority of either strategy, rest assured both do work to some degree.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running on Windows 7 with msys installed along with gcc and the source for
(Running MingW on 64-bit Windows 7 and the GCC on Kubuntu) This may possibly
Beginner hobby programmer here. I'm used to running C in OSX compiling with GCC
I am running a Eclipse for C/C++ using cygwin GCC. I need to get
I would like to install bitarray in Windows running python 2.6. I have mingw32
I am running Windows XP 64 bit. I want to hide the taskbar when
I'm running Windows 7 - x64 Edition with IIS 7.5 I have a simple
I'm running Windows 7 with UAC enabled . I've always found it weird that
I'm running Windows 7 Ultimate (64 bit) using Visual Studio 2010 RC. I recently
I'm running Windows 7 and Visual Studio 2008 Pro and trying to get my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.