summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/tar01/Makefile.am
blob: d7257bc69fe35d3ed3baad467bb6947916f9acac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
if TARTESTS
rtems_tests_PROGRAMS = tar01
tar01_SOURCES =
tar01_SOURCES += init.c
tar01_SOURCES += ../../psxtests/psxfile01/test_cat.c
tar01_SOURCES += initial_filesystem_tar.c
tar01_SOURCES += initial_filesystem_tar.h
tar01_SOURCES += initial_filesystem_tar_gz.c
tar01_SOURCES += initial_filesystem_tar_gz.h

tar01_LDADD = -lrtemscpu -lz
  
BUILT_SOURCES =
BUILT_SOURCES += initial_filesystem_tar.c
BUILT_SOURCES += initial_filesystem_tar.h
BUILT_SOURCES += initial_filesystem_tar_gz.c
BUILT_SOURCES += initial_filesystem_tar_gz.h

dist_rtems_tests_DATA = tar01.scn
dist_rtems_tests_DATA += tar01.doc
endif TARTESTS

include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../automake/compile.am
include $(top_srcdir)/../automake/leaf.am

if TARTESTS
AM_CPPFLAGS += -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/../support/include
AM_CPPFLAGS += -I$(top_srcdir)/../psxtests/include

LINK_OBJS = $(tar01_OBJECTS) $(tar01_LDADD)
LINK_LIBS = $(tar01_LDLIBS)

tar01$(EXEEXT): $(tar01_OBJECTS) $(tar01_DEPENDENCIES)
	@rm -f tar01$(EXEEXT)
	$(make-exe)

initial_filesystem_tar.c: initial_filesystem.tar
	$(BIN2C) -C initial_filesystem.tar initial_filesystem_tar
CLEANFILES += initial_filesystem_tar.c

initial_filesystem_tar.h: initial_filesystem.tar
	$(BIN2C) -H initial_filesystem.tar initial_filesystem_tar
CLEANFILES += initial_filesystem_tar.h

initial_filesystem_tar_gz.c: initial_filesystem.tar.gz
	$(BIN2C) -C initial_filesystem.tar.gz initial_filesystem_tar_gz
CLEANFILES += initial_filesystem_tar_gz.h

initial_filesystem_tar_gz.h: initial_filesystem.tar.gz
	$(BIN2C) -H initial_filesystem.tar.gz initial_filesystem_tar_gz
CLEANFILES += initial_filesystem_tar_gz.h

initial_filesystem.tar:
	rm -rf initial_fs
	$(MKDIR_P) initial_fs/home
	(echo "This is a test of loading an RTEMS filesystem from an" ; \
	echo "initial tar image.") >initial_fs/home/test_file
	(cd initial_fs; \
	$(LN_S) home/test_file symlink; \
	$(PAX) -w -f ../initial_filesystem.tar home symlink)
CLEANFILES += initial_filesystem.tar

initial_filesystem.tar.gz: initial_filesystem.tar
	$(GZIP) < initial_filesystem.tar > initial_filesystem.tar.gz
CLEANFILES += initial_filesystem.tar.gz

endif TARTESTS

clean-local:
	-rm -rf initial_fs

include $(top_srcdir)/../automake/local.am