File tree 5 files changed +47
-5
lines changed 5 files changed +47
-5
lines changed Original file line number Diff line number Diff line change 2
2
# isn't marked as an executable (target), which CMake requires. Thus construct a
3
3
# path in the same way the symbolic link is created in the goto-cc directory.
4
4
add_test_pl_tests("$<TARGET_FILE_DIR:goto-cc>/goto-gcc" )
5
+
6
+ add_custom_command (OUTPUT "${CMAKE_CURRENT_SOURCE_DIR} /archives/libour_archive.a"
7
+ COMMAND "$<TARGET_FILE_DIR:goto-cc>/goto-gcc" -c foo.c
8
+ COMMAND ${CMAKE_AR} rcs libour_archive.a foo.o
9
+ DEPENDS "$<TARGET_FILE_DIR:goto-cc>/goto-gcc"
10
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} /archives"
11
+ )
12
+
13
+ add_custom_target (libour_archive.a ALL
14
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR} /archives/libour_archive.a"
15
+ )
Original file line number Diff line number Diff line change 1
1
default : tests.log
2
2
3
- test :
4
- -@ln -s goto-cc ../../src/goto-cc/goto-gcc
3
+ test : ../../src/goto-cc/goto-gcc
5
4
@../test.pl -p -c ../../../src/goto-cc/goto-gcc
6
5
7
- tests.log : ../test.pl
8
- -@ln -s goto-cc ../../src/goto-cc/goto-gcc
6
+ tests.log : ../test.pl ../../src/goto-cc/goto-gcc
9
7
@../test.pl -p -c ../../../src/goto-cc/goto-gcc
10
8
9
+ ../../src/goto-cc/goto-gcc : ../../src/goto-cc/goto-cc
10
+ @ln -sf goto-cc ../../src/goto-cc/goto-gcc
11
+
12
+ test tests.log : archives/libour_archive.a
13
+ archives/libour_archive.a : archives/foo.c ../../src/goto-cc/goto-gcc
14
+ @cd archives && \
15
+ ../../../src/goto-cc/goto-gcc -c foo.c && \
16
+ $(AR ) rcs libour_archive.a foo.o
17
+
11
18
show :
12
19
@for dir in * ; do \
13
20
if [ -d " $$ dir" ]; then \
19
26
find -name ' *.out' -execdir $(RM ) ' {}' \;
20
27
find -name ' *.gb' -execdir $(RM ) ' {}' \;
21
28
find -name ' *.goto-cc-saved' -execdir $(RM ) ' {}' \;
22
- $(RM ) tests.log
29
+ $(RM ) tests.log archives/lib_ourarchive.a archives/foo.o
Original file line number Diff line number Diff line change
1
+ int foo ()
2
+ {
3
+ return 0 ;
4
+ }
Original file line number Diff line number Diff line change
1
+ int foo ();
2
+
3
+ int main ()
4
+ {
5
+ return foo ();
6
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ 10
3
+ main.c -L. -lour_archive --verbosity
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^Reading: .*/foo.o$
7
+ --
8
+ ^warning: ignoring
9
+ ^CONVERSION ERROR$
10
+ --
11
+ We need to make sure main.c is listed before the archive for the Linux linker to
12
+ pick up dependencies - thus "main.c" is given as an argument on line 3 in this
13
+ file and the "10" in line 2 is a dummy to be appended at the end, setting the
14
+ verbosity as needed.
You can’t perform that action at this time.
0 commit comments