Blob Blame History Raw
From 22b01fefa879c3a7b1719e76a78df8adb1a8c8e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sun, 28 Jul 2019 14:56:54 +0200
Subject: [PATCH 31/36] test_cc1541: Flatten the directory tree.

There are just two source files in the whole tree, thus
it makes more sense to keep them in the same directory.
---
 .gitignore                                     |  4 ++--
 Makefile                                       | 18 +++++++++++-------
 bitbucket-pipelines.yml                        | 10 +++-------
 test_cc1541/test_cc1541.c => test_cc1541.c     |  0
 .../test_cc1541.vcxproj => test_cc1541.vcxproj |  0
 ...proj.filters => test_cc1541.vcxproj.filters |  0
 test_cc1541/Makefile                           | 13 -------------
 7 files changed, 16 insertions(+), 29 deletions(-)
 rename test_cc1541/test_cc1541.c => test_cc1541.c (100%)
 rename test_cc1541/test_cc1541.vcxproj => test_cc1541.vcxproj (100%)
 rename test_cc1541/test_cc1541.vcxproj.filters => test_cc1541.vcxproj.filters (100%)
 delete mode 100644 test_cc1541/Makefile

diff --git a/.gitignore b/.gitignore
index 331ebd7..3c55e78 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,5 +7,5 @@
 # Compiled applications.
 /cc1541
 /cc1541.exe
-test_cc1541/test_cc1541
-test_cc1541/test_cc1541.exe
+/test_cc1541
+/test_cc1541.exe
diff --git a/Makefile b/Makefile
index 4f1e13e..19cdde9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,18 @@
+all: cc1541
+
 cc1541: cc1541.o
 	$(CC) -o $@ $^ $(LDFLAGS)
 
-%.o: %.c
-	$(CC) -std=c99 $(CFLAGS) -c $<
+test_cc1541: test_cc1541.o
+	$(CC) -o $@ $^ $(LDFLAGS)
 
-test: cc1541
-	$(MAKE) -C test_cc1541/ test
+check: cc1541 test_cc1541
+	./test_cc1541 ./cc1541
 
-check: test
+test: check
 
 clean:
-	rm -rf *.o cc1541 *~
-	$(MAKE) -C test_cc1541/ clean
+	rm -rf *.o cc1541 test_cc1541 *~
+
+%.o: %.c
+	$(CC) -std=c99 $(CFLAGS) -c $<
diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml
index 34cf4c8..4952a16 100644
--- a/bitbucket-pipelines.yml
+++ b/bitbucket-pipelines.yml
@@ -5,9 +5,7 @@ pipelines:
         image: alpine:3.7
         script:
           - apk add build-base
-          - make
-          - cd test_cc1541
-          - make test
+          - make check
         artifacts:
           - cc1541
     - step:
@@ -15,11 +13,9 @@ pipelines:
         image: purplekarrot/mingw-w64-i686
         trigger: manual
         script:
-          - make CC=i686-w64-mingw32-gcc
+          - make cc1541 test_cc1541 CC=i686-w64-mingw32-gcc
           - mv cc1541 cc1541.exe
-          - cd test_cc1541
-          - make CC=i686-w64-mingw32-gcc
           - mv test_cc1541 test_cc1541.exe
-          - wine test_cc1541.exe ../cc1541.exe
+          - wine ./test_cc1541.exe ./cc1541.exe
         artifacts:
           - cc1541.exe
diff --git a/test_cc1541/test_cc1541.c b/test_cc1541.c
similarity index 100%
rename from test_cc1541/test_cc1541.c
rename to test_cc1541.c
diff --git a/test_cc1541/test_cc1541.vcxproj b/test_cc1541.vcxproj
similarity index 100%
rename from test_cc1541/test_cc1541.vcxproj
rename to test_cc1541.vcxproj
diff --git a/test_cc1541/test_cc1541.vcxproj.filters b/test_cc1541.vcxproj.filters
similarity index 100%
rename from test_cc1541/test_cc1541.vcxproj.filters
rename to test_cc1541.vcxproj.filters
diff --git a/test_cc1541/Makefile b/test_cc1541/Makefile
deleted file mode 100644
index 59f3f8d..0000000
--- a/test_cc1541/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-test_cc1541: test_cc1541.o
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-%.o: %.c
-	$(CC) -std=c99 $(CFLAGS) -c $<
-
-test: test_cc1541
-	./test_cc1541 ../cc1541
-
-check: test
-
-clean:
-	rm -rf *.o test_cc1541 *~
-- 
2.21.0