Skip to content

Commit

Permalink
Merge pull request datto#20 from Conan-Kudo/fixMakefile
Browse files Browse the repository at this point in the history
Rename img-merge to update-img, add install target for utils, and delete Makefile.in files
  • Loading branch information
Tom Caputi committed Feb 26, 2016
2 parents fcc2552 + 66d0fc0 commit 86ffe46
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 77 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ clean:
install:
$(MAKE) -C lib install
$(MAKE) -C app install
$(MAKE) -C utils install

install-static:
$(MAKE) -C app install-static
18 changes: 0 additions & 18 deletions app/Makefile.in

This file was deleted.

26 changes: 0 additions & 26 deletions lib/Makefile.in

This file was deleted.

19 changes: 0 additions & 19 deletions src/Makefile.in

This file was deleted.

16 changes: 12 additions & 4 deletions utils/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
.PHONY: all clean
BINARY_NAME = update-img
INSTALLDIR = $(PREFIX)/bin
SOURCES = update-img.c

.PHONY: all clean install

all:
gcc -Wall -o img-merge img-merge.c

$(CC) $(CCFLAGS) -o $(BINARY_NAME) -L $(BASE_DIR)/utils $(SOURCES)

install: all
mkdir -p $(INSTALLDIR)
install $(BINARY_NAME) $(INSTALLDIR)

clean:
rm -f img-merge
rm -f $(BINARY_NAME)
7 changes: 0 additions & 7 deletions utils/Makefile.in

This file was deleted.

6 changes: 3 additions & 3 deletions utils/img-merge.c → utils/update-img.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

typedef unsigned long long sector_t;

static void print_help(int status){
printf("Usage: img-merge <snapshot device> <cow file> <image file>\n");
static void print_help(char* progname, int status){
printf("Usage: %s <snapshot device> <cow file> <image file>\n", progname);
exit(status);
}

Expand Down Expand Up @@ -64,7 +64,7 @@ int main(int argc,char *argv[]){
FILE *cow = NULL, *snap = NULL, *img = NULL;
uint64_t *mappings = NULL;

if(argc != 4) print_help(-1);
if(argc != 4) print_help(argv[0], -1);

//open snapshot
snap = fopen(argv[1], "r");
Expand Down

0 comments on commit 86ffe46

Please sign in to comment.