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 8358995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:59:46+00:00 2026-06-09T10:59:46+00:00

H Hello, everyone. I intent to write a batch(umake.bat) file that does the following:

  • 0

H Hello, everyone. I intent to write a batch(umake.bat) file that does the following:

Check whether -f appears in one of bat parameters, so that I can take different actions in the .bat.

CASE 1:

User call

umake 

Inside umake.bat I will execute

make -f Makefile.umk

CASE 2:

User call

umake debug=1 var="big cat"

Inside umake.bat I will execute

make debug=1 var="big cat" -f Makefile.umk

CASE 3:

User call

umake -f special.mk debug=1

Inside umake.bat I will execute

make -f special.mk debug=1

CASE 4:

User call

umake debug=1 -f

Inside umake.bat I will execute

make debug=1 -f

In case 4, make(GNU make) will not succeed because missing file name after -f . For simplicity, I don’t have to care for this since it is user’s fault and the problem will be reported by GNU make .

Summary:

  • If user provide -f xxx in command parameter, I’ll pass those parameter to make .
  • If user does not provide -f xxx, I’ll call make with all user’s parameter as well as appending -f Makefile.umk as make‘s extra parameters.

Thank you.

  • 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-06-09T10:59:47+00:00Added an answer on June 9, 2026 at 10:59 am

    I seems to have found the solution, although the code is something verbose.

    @echo off
    
    set _F_MAKEFILE=-f Makefile.umk
    
    :CHECK_PARAM_AGAIN
    if "%~1" == "" (
      goto CHECK_PARAM_DONE
    ) else (
      if "%~1" == "-f" (
        set _F_MAKEFILE=
        goto CHECK_PARAM_DONE
      )
      rem echo @@@%1
      shift
    )
    goto CHECK_PARAM_AGAIN
    
    :CHECK_PARAM_DONE
    
    @echo on
    make %* %_F_MAKEFILE%
    

    NOTES:

    • Using %~1 is a must. Because: If %1 has value "big cat", %~1 makes it big cat , so that we can surrond %~1 with quotes.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello everyone im trying to create this tweak that copies a file from one
Hello again everyone, This time I have a problem with Intent & Extras. here's
hello everyone I am trying to make a script that steps through a list
Hello everyone i have a problem in my application. The check in my check
Hello everyone. I'm using Silverlight webbrowser control, and I'm having some problems with that.
hello everyone i want validate the type of file being uploaded on sever to
Hello everyone, I am using hibernate ORM and oracle database. My cfg file has
Hello Everyone I am new being in ANDROID so I am getting one problem
Hello everyone it's been some days that I use sql to make analysis and
Hello everyone and thanks in advance for reading this.. I have the following html

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.