Commit 558bb85a authored by ASCP's avatar ASCP 💬

Initial commit

parents
# Ignore the build and lib dirs
src/build
src/bin
lib/*
# Ignore any executables
src/bin/*
# Ignore Mac specific files
.DS_Store
# Ignore FS-Uae files
*.uaem
# Ignore temp files
*.swp
# Ignore object files
*.o
# Changelog
All notable changes to this project will be documented in this file.
The format is based on http://keepachangelog.com/en/1.0.0/[Keep a Changelog]
and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioning].
## [1.0.0] - 2018-05-13
### Added
- Initial project
MIT License
Copyright (c) 2017 John Girvin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# BuildTime
**Description**: Simple program to output time in a number of formats to ENV variables
**Technology stack**: C, SAS/C 6.5x
**Project Status**: https://gitlab.com/amigasourcecodepreservation/buildtime/blob/master/CHANGELOG.adoc[CHANGELOG]
## Dependencies
* Amiga OS Classic
* SAS/C 6.5x or compatible compiler
## Installation
* Put BuildTime in your path.
## Getting help
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.
## Getting involved
Contact your old amiga friends and tell them about our project, and ask them to dig out their source code or floppies and send them to us for preservation.
Clean up our hosted archives, and make the source code buildable with standard compilers like devpac, asmone, gcc 2.9x/Beppo 6.x, sas/c ,vbcc and friends.
Cheers!
....
_____ ___ _ __ __ _ __ __ ___ ___ _
|_ _| __| /_\ | \/ | /_\ | \/ |_ _/ __| /_\
| | | _| / _ \| |\/| | / _ \| |\/| || | (_ |/ _ \
_|_| |___/_/ \_\_|_ |_|_/_/_\_\_|__|_|___\___/_/_\_\
/ __|/ _ \| | | | _ \/ __| __| / __/ _ \| \| __|
\__ \ (_) | |_| | / (__| _| | (_| (_) | |) | _|
|___/\___/_\___/|_|_\\___|___|__\___\___/|___/|___|_
| _ \ _ \ __/ __| __| _ \ \ / /_\_ _|_ _/ _ \| \| |
| _/ / _|\__ \ _|| /\ V / _ \| | | | (_) | .` |
|_| |_|_\___|___/___|_|_\ \_/_/ \_\_| |___\___/|_|\_|
....
https://twitter.com/AmigaSourcePres[Twitter]
https://gitlab.com/amigasourcecodepreservation[Gitlab]
https://amigasourcepres.gitlab.io/[WWW]
## Licensing
BuildTime is distributed under the terms of the MIT License. See the https://gitlab.com/amigasourcecodepreservation/buildtime/LICENSE[LICENSE] file for details.
## Credits and references
Many thanks to John Girvin for the source code.
#
# :ts=8
#
TARGET = \
src/bin/BuildTime
###############################################################################
all: $(TARGET)
###############################################################################
src/bin/BuildTime:
execute <<
cd src
smake
<
###############################################################################
clean:
execute <<
cd src
smake clean
<
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/exec_pragmas.h>
#include <dos.h>
#include <exec/types.h>
extern struct Library *DOSBase;
/*
* Simple program to output time in a number of
* formats to ENV variables
*/
static char Ver[] = "$VER: BuildTime [" __AMIGADATE__ "] (c) John Girvin\n";
/*
* Structure to define the things we will output
*/
typedef struct S_timdef
{
char *td_fmt; // strftime format string
char *td_fnam; // output filename
};
/*
* Actually define the output formats
*/
#define MAX_TIMELEN (100)
static struct S_timdef OutTimes[] =
{ "%a %d-%b-%y, %H:%M", "ENV:BuildTime.s",
"%d-%m-%y %H:%M" , "ENV:BuildTimeS.s",
"%d.%m.%y" , "ENV:BuildTimeA.s",
NULL , NULL
};
ULONG main(void)
{
ULONG d;
time_t ttTime;
struct tm tmTime;
struct S_timdef *timdef;
BPTR filptr;
UBYTE filbuf[MAX_TIMELEN];
ULONG buflen;
__tzset();
// Endless loop (until CTRL-C)
while(TRUE)
{
// Get current time and store
if (time(&ttTime) != -1)
{
CopyMem(localtime(&ttTime), &tmTime, sizeof(tmTime));
// Process all time formats
timdef = OutTimes;
while (timdef->td_fmt != NULL)
{
if ((filptr = Open(timdef->td_fnam, MODE_NEWFILE)) != NULL)
{
// Write header
Write(filptr, "\tdc.b\t\"", 7);
// Format and write time string
buflen = strftime(filbuf, MAX_TIMELEN, timdef->td_fmt, &tmTime);
Write(filptr, filbuf, buflen);
// Write trailer
Write(filptr, "\"\t;Written by BuildTime\n", 24);
Close(filptr);
}
timdef++;
}
}
// Sleep for a minute
for (d = 0; d < 60; d++)
{
Delay(50);
}
}
}
CPU=68060
NOSTACKCHECK
OPTIMIZE
LINK
OPTIMIZERSIZE
SMALLCODE
SMALLDATA
STRIPDEBUG
OPTIMIZERSCHEDULER
NOICONS
OPTIMIZERALIAS
#
# :ts=4
#
#
INCLUDE = include:
BUILD_DIR = build
BIN = bin
.c.o:
sc $(CFLAGS) OBJNAME $@ $<
###############################################################################
#OPTIMIZE = optimize opttime optinline optschedule
#CPU = 060
CPU = any
DEBUG = line
#DEBUG = symbolflush noopt define=DEBUG
###############################################################################
CFLAGS = idlen=64 comnest data=far streq strmerge nostkchk \
$(OPTIMIZE) cpu=$(CPU) debug=$(DEBUG) \
strsect=code idir=$(INCLUDE)
LFLAGS = smallcode smalldata noicons batch
###############################################################################
OBJS = \
$(BUILD_DIR)/BuildTime.o
LIBS = LIB:sc.lib LIB:amiga.lib
###############################################################################
all: $(BIN)/BuildTime
$(BIN)/BuildTime : $(OBJS)
slink lib:c.o $(OBJS) to $@.debug lib $(LIBS) $(LFLAGS) map $@.map,fhx fwidth 32 pwidth 32 swidth 32
slink $@.debug to $@ noicons nodebug
###############################################################################
$(BUILD_DIR)/BuildTime.o : BuildTime.c
###############################################################################
clean:
-delete build/*.* bin/*.* bin/* build/*
###############################################################################
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment