how to write a makefile based on date


 
Thread Tools Search this Thread
Top Forums Programming how to write a makefile based on date
# 1  
Old 01-07-2012
how to write a makefile based on date

I have 30 files(all are .c file) based on each day of a month. And a app.c and app.h. Now I want to write a makefile to bulid the application based on the date of system. The 1st day I build the 1st day's .c file. Like this.
# 2  
Old 01-07-2012
make -f Makefile.insertdatehere
# 3  
Old 01-08-2012
I just want a makefile and this makefile should be executed by "make makefile"
# 4  
Old 01-08-2012
Makefiles don't work that way. running 'make makefile' tries to find a target named makefile, not a file named makefile.

The proper syntax is the one you didn't want.

Makefiles aren't batch files, either. They run commands based on what target you asked for and what things have been built already. Would you really want your program deciding it didn't need to build again because it already built one that month last year? Make files don't sound appropriate for this.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

HP/UX command to pull file name/date based on date

HI, Can anyone tell me how to pull the date and file name separated by a space using the find command or any other command. I want to look through several directories and based on a date timeframe (find -mtime -7), output the file name (without the path) and the date(in format mmddyyyy) to a... (2 Replies)
Discussion started by: lnemitz
2 Replies

2. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies

3. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies

4. UNIX for Dummies Questions & Answers

Copy log based on from-date and to-date

Hi all, i go a customer support requirement where i need to scan several files based on from/to date like 1-oct to 2-oct please help... (3 Replies)
Discussion started by: AbhiJ
3 Replies

5. Shell Programming and Scripting

To write shell script based on 1 and 4th columns

Hi, I am trying to write shell script for below requirement File has below values @mqm soft nproc 75000 @mqm hard nproc 75000 @mqm soft nofiles 76492 @mqm hard nofiles 76492 @mqm soft locks 76492 @mqm hard ... (7 Replies)
Discussion started by: darling
7 Replies

6. UNIX for Dummies Questions & Answers

How to write a shell script to Run it the from Date A to Date B?

Hi , How would i write a shell script to run the code from one date to another date EXample 2014-01-01 to 2014-02-28, can i any provide some clue on this (4 Replies)
Discussion started by: vikatakavi
4 Replies

7. UNIX for Dummies Questions & Answers

Condition based on Timestamp (Date/Time based) from logfile (Epoch seconds)

Below is the sample logfile: Userids Date Time acb Checkout time: 2013-11-20 17:00 axy Checkout time: 2013-11-22 12:00 der Checkout time: 2013-11-17 17:00 xyz Checkout time: 2013-11-19 16:00 ddd Checkout time: 2013-11-21 16:00 aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies

8. Shell Programming and Scripting

How to write to different files based on a column

Hi, I have the following sample file 32895901-d17f-414c-ac93-3e7e0f5ec240 AND @GDF_INPUT 73b129e1-1fa9-4c0d-b95b-4682e5389612 AUS @GDF_INPUT 40f82e88-d1ff-4ce2-9b8e-d827ddb39447 BEL @GDF_INPUT ffbcc6fe-ba35-489c-ae08-e70e8897aa23 BEL @FF_INPUT... (3 Replies)
Discussion started by: ramky79
3 Replies

9. Shell Programming and Scripting

Get the oldest date based on date in the filename

I am using ksh93 on Solaris. Ok, this may seem like a simple request at first. I have a directory that contains sets of files with a YYYYMMDD component to the name, along with other files of different filespecs. something like this: 20110501_1.dat 20110501_2.dat 20110501_3.dat... (2 Replies)
Discussion started by: gary_w
2 Replies

10. Programming

How to write configure and makefile

Hi, I am new to writing programs for linux (although have programmed extensively in C,C++ before on windows.).I want to write the configure and makefile for the programs I recently wrote in linux (Ubuntu 9.04) so as to easily install them on other *nix systems. Please do guide me how to write... (3 Replies)
Discussion started by: dheerajsuthar
3 Replies
Login or Register to Ask a Question