1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Added the base_dir_nametest test program.

git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15154 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2006-09-25 18:20:09 +00:00
parent b8ba11b158
commit 0b833b8680
2 changed files with 27 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: GNUmakefile.68k,v 1.14 2006-09-20 19:46:37 obarthel Exp $
# $Id: GNUmakefile.68k,v 1.15 2006-09-25 18:20:09 obarthel Exp $
#
# :ts=8
#
@ -49,13 +49,13 @@ LIBS = -lm -lc -lgcc
all: test fgets_test iotest sscanf_test printf_test sprintf_test \
stack_size_test translate_test strtok_test uname simple \
fstat_stdout_test simple_sprintf date_test sscanf_64 factorial \
execvp_test setlocale rand fstat_test
execvp_test setlocale rand fstat_test base_dir_nametest
clean:
$(DELETE) #?.o #?.map test fgets_test iotest sscanf_test printf_test \
sprintf_test stack_size_test translate_test strtok_test uname \
simple fstat_stdout_test fstat_test simple_sprintf date_test sscanf_64 \
factorial execvp_test setlocale rand
factorial execvp_test setlocale rand base_dir_nametest
##############################################################################
@ -135,6 +135,10 @@ execvp_test : execvp_test.o
@echo "Linking $@"
$(CC) $(CFLAGS) -o $@ execvp_test.o -lunix $(LIBS) -Wl,--cref,-M,-Map=$@.map
base_dir_nametest : base_dir_nametest.o
@echo "Linking $@"
$(CC) $(CFLAGS) -o $@ base_dir_nametest.o -lunix $(LIBS) -Wl,--cref,-M,-Map=$@.map
rand : rand.o
@echo "Linking $@"
$(CC) $(CFLAGS) -o $@ rand.o $(LIBS) -Wl,--cref,-M,-Map=$@.map

View File

@ -0,0 +1,20 @@
/*
* $Id: base_dir_nametest.c,v 1.1 2006-09-25 18:20:09 obarthel Exp $
*
* :ts=4
*/
#include <unistd.h>
#include <libgen.h>
#include <stdio.h>
int
main(int argc,char ** argv)
{
int i;
for(i = 1 ; i < argc ; i++)
printf("%s\n\tbasename=%s\n\t dirname=%s\n",argv[i],basename(argv[i]),dirname(argv[i]));
return(0);
}