From 2c581b262caee6b1d5cf149c20bc51cd15f318c2 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Wed, 3 Dec 2014 00:07:30 +0100 Subject: [PATCH] Move code to the "src" subdirectory --- Makefile | 37 +++++++++++++++++------------- crc.c => src/crc.c | 0 crc.h => src/crc.h | 0 filenode.c => src/filenode.c | 0 filenode.h => src/filenode.h | 0 filenodecmp.c => src/filenodecmp.c | 0 filenodecmp.h => src/filenodecmp.h | 0 fileutil.c => src/fileutil.c | 0 fileutil.h => src/fileutil.h | 0 main.c => src/main.c | 0 util.c => src/util.c | 0 util.h => src/util.h | 0 12 files changed, 21 insertions(+), 16 deletions(-) rename crc.c => src/crc.c (100%) rename crc.h => src/crc.h (100%) rename filenode.c => src/filenode.c (100%) rename filenode.h => src/filenode.h (100%) rename filenodecmp.c => src/filenodecmp.c (100%) rename filenodecmp.h => src/filenodecmp.h (100%) rename fileutil.c => src/fileutil.c (100%) rename fileutil.h => src/fileutil.h (100%) rename main.c => src/main.c (100%) rename util.c => src/util.c (100%) rename util.h => src/util.h (100%) diff --git a/Makefile b/Makefile index f7b45d1..37aee2b 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,33 @@ -CC=gcc -RM=rm -f -ECHO=echo -MKDIR=mkdir +CC = gcc +RM = rm -f +ECHO = echo +MKDIR = mkdir + +HEADS = \ + src/util.h \ + src/crc.h \ + src/fileutil.h \ + src/filenode.h -HEADS = util.h crc.h fileutil.h filenode.h OBJS_BASE = \ $(BUILDDIR)/util.o \ $(BUILDDIR)/crc.o \ $(BUILDDIR)/fileutil.o \ $(BUILDDIR)/filenode.o \ $(BUILDDIR)/filenodecmp.o + OBJS_APP = \ $(OBJS_BASE) \ $(BUILDDIR)/main.o -RES_APP=filesync +RES_APP = filesync.exe -CFLAGS = -g -LIBS = -lm +CFLAGS = -g +LIBS = -lm BUILDDIR = build - DO_CC=@$(ECHO) "CC: $@" ;\ $(CC) $(CFLAGS) -o $@ -c $< @@ -30,7 +35,7 @@ all: $(RES_APP) clean: - $(RM) $(OBJS_BASE) + $(RM) $(RES_APP) $(RM) $(OBJS_APP) $(BUILDDIR): @@ -38,23 +43,23 @@ $(BUILDDIR): -$(BUILDDIR)/util.o: util.c $(HEADS) +$(BUILDDIR)/util.o: src/util.c $(HEADS) $(DO_CC) -$(BUILDDIR)/crc.o: crc.c $(HEADS) +$(BUILDDIR)/crc.o: src/crc.c $(HEADS) $(DO_CC) -$(BUILDDIR)/fileutil.o: fileutil.c $(HEADS) +$(BUILDDIR)/fileutil.o: src/fileutil.c $(HEADS) $(DO_CC) -$(BUILDDIR)/filenode.o: filenode.c $(HEADS) +$(BUILDDIR)/filenode.o: src/filenode.c $(HEADS) $(DO_CC) -$(BUILDDIR)/filenodecmp.o: filenodecmp.c $(HEADS) +$(BUILDDIR)/filenodecmp.o: src/filenodecmp.c $(HEADS) $(DO_CC) -$(BUILDDIR)/main.o: main.c $(HEADS) +$(BUILDDIR)/main.o: src/main.c $(HEADS) $(DO_CC) diff --git a/crc.c b/src/crc.c similarity index 100% rename from crc.c rename to src/crc.c diff --git a/crc.h b/src/crc.h similarity index 100% rename from crc.h rename to src/crc.h diff --git a/filenode.c b/src/filenode.c similarity index 100% rename from filenode.c rename to src/filenode.c diff --git a/filenode.h b/src/filenode.h similarity index 100% rename from filenode.h rename to src/filenode.h diff --git a/filenodecmp.c b/src/filenodecmp.c similarity index 100% rename from filenodecmp.c rename to src/filenodecmp.c diff --git a/filenodecmp.h b/src/filenodecmp.h similarity index 100% rename from filenodecmp.h rename to src/filenodecmp.h diff --git a/fileutil.c b/src/fileutil.c similarity index 100% rename from fileutil.c rename to src/fileutil.c diff --git a/fileutil.h b/src/fileutil.h similarity index 100% rename from fileutil.h rename to src/fileutil.h diff --git a/main.c b/src/main.c similarity index 100% rename from main.c rename to src/main.c diff --git a/util.c b/src/util.c similarity index 100% rename from util.c rename to src/util.c diff --git a/util.h b/src/util.h similarity index 100% rename from util.h rename to src/util.h