diff options
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | Makefile | 21 | ||||
| -rw-r--r-- | src/Makefile | 19 | ||||
| -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/Makefile | 2 |
13 files changed, 27 insertions, 19 deletions
@@ -1,3 +1,3 @@ *~ -diff-dd -program_info.h +src/diff-dd +src/program_info.h @@ -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/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/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) |
