aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile21
-rw-r--r--src/Makefile19
-rw-r--r--src/file.c (renamed from file.c)0
-rw-r--r--src/file.h (renamed from file.h)0
-rw-r--r--src/main.c (renamed from main.c)0
-rw-r--r--src/options.c (renamed from options.c)0
-rw-r--r--src/options.h (renamed from options.h)0
-rw-r--r--src/print.c (renamed from print.c)0
-rw-r--r--src/print.h (renamed from print.h)0
-rw-r--r--src/resources.c (renamed from resources.c)0
-rw-r--r--src/resources.h (renamed from resources.h)0
-rw-r--r--tests/Makefile2
13 files changed, 27 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 13e7c1a..3dc9774 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
*~
-diff-dd
-program_info.h
+src/diff-dd
+src/program_info.h
diff --git a/Makefile b/Makefile
index 04b5c90..dcd38c3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,11 @@
PROGRAM_NAME=diff-dd
PROGRAM_VERSION=1.0
-# Program name is used in the tests to locate the executable file
-export PROGRAM_NAME
-
-CC=gcc
-CFLAGS=-Wall
-
-SOURCES=*.c
-HEADERS=*.h
-all: $(PROGRAM_NAME)
-
-$(PROGRAM_NAME): $(SOURCES) $(HEADERS) program_info.h
- $(CC) $(CFLAGS) -o $(PROGRAM_NAME) $(SOURCES)
+export PROGRAM_NAME
+export PROGRAM_VERSION
-program_info.h:
- echo "#define PROGRAM_NAME_STR \"$(PROGRAM_NAME)\"" >program_info.h
- echo "#define PROGRAM_VERSION_STR \"$(PROGRAM_VERSION)\"" >>program_info.h
+all:
+ $(MAKE) -C src all
.PHONY: test clean
@@ -24,4 +13,4 @@ test: all
$(MAKE) -C tests
clean:
- rm -f *.o *~ $(PROGRAM_NAME) program_info.h
+ $(MAKE) -C src clean
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..8b24b35
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,19 @@
+CC=gcc
+CFLAGS=-Wall
+
+SOURCES=*.c
+HEADERS=*.h
+
+all: $(PROGRAM_NAME)
+
+$(PROGRAM_NAME): $(SOURCES) $(HEADERS) program_info.h
+ $(CC) $(CFLAGS) -o $(PROGRAM_NAME) $(SOURCES)
+
+program_info.h:
+ echo "#define PROGRAM_NAME_STR \"$(PROGRAM_NAME)\"" >program_info.h
+ echo "#define PROGRAM_VERSION_STR \"$(PROGRAM_VERSION)\"" >>program_info.h
+
+.PHONY: clean
+
+clean:
+ rm -f *.o *~ $(PROGRAM_NAME) program_info.h
diff --git a/file.c b/src/file.c
index c6823b9..c6823b9 100644
--- a/file.c
+++ b/src/file.c
diff --git a/file.h b/src/file.h
index d62b1ba..d62b1ba 100644
--- a/file.h
+++ b/src/file.h
diff --git a/main.c b/src/main.c
index ea94921..ea94921 100644
--- a/main.c
+++ b/src/main.c
diff --git a/options.c b/src/options.c
index 2017ba5..2017ba5 100644
--- a/options.c
+++ b/src/options.c
diff --git a/options.h b/src/options.h
index 71259aa..71259aa 100644
--- a/options.h
+++ b/src/options.h
diff --git a/print.c b/src/print.c
index 824f818..824f818 100644
--- a/print.c
+++ b/src/print.c
diff --git a/print.h b/src/print.h
index 7992087..7992087 100644
--- a/print.h
+++ b/src/print.h
diff --git a/resources.c b/src/resources.c
index 3eebd1c..3eebd1c 100644
--- a/resources.c
+++ b/src/resources.c
diff --git a/resources.h b/src/resources.h
index 0cf9777..0cf9777 100644
--- a/resources.h
+++ b/src/resources.h
diff --git a/tests/Makefile b/tests/Makefile
index e202c55..fc86402 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,4 +1,4 @@
-PROGRAM_EXEC=../$(PROGRAM_NAME)
+PROGRAM_EXEC=../src/$(PROGRAM_NAME)
all:
sh ./001-no_options_given.sh $(PROGRAM_EXEC)