From 8d82e8235bdbd233267d53316fbf44e91ff5d5e4 Mon Sep 17 00:00:00 2001 From: John Jones Date: Mon, 7 Nov 2016 16:29:30 -0500 Subject: [PATCH] Adjusted makefiles --- Makefile | 3 +++ cmd/ipfs/Makefile | 2 +- commands/Makefile | 4 ++-- commands/argument.c | 2 +- commands/cli/Makefile | 2 +- commands/command.c | 2 +- core/Makefile | 2 +- include/ipfs/commands/command.h | 4 ++-- include/ipfs/commands/command_option.h | 2 ++ {commands => include/ipfs/commands}/request.h | 0 os/Makefile | 4 ++-- os/utils.c | 2 +- repo/Makefile | 4 ++-- repo/config/Makefile | 2 +- repo/config/config.c | 2 +- repo/fsrepo/Makefile | 4 ++-- repo/fsrepo/fs_repo.c | 4 ++-- test/Makefile | 11 +++++++---- thirdparty/Makefile | 6 ++++++ thirdparty/ipfsaddr/Makefile | 13 +++++++++++++ 20 files changed, 51 insertions(+), 24 deletions(-) rename {commands => include/ipfs/commands}/request.h (100%) create mode 100644 thirdparty/Makefile create mode 100644 thirdparty/ipfsaddr/Makefile diff --git a/Makefile b/Makefile index 9a73d52..862bc1c 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ all: cd os; make all; cd repo; make all; cd test; make all; + cd thirdparty; make all; clean: cd cmd; make clean; @@ -13,3 +14,5 @@ clean: cd os; make clean; cd repo; make clean; cd test; make clean; + cd thirdparty; make clean; + diff --git a/cmd/ipfs/Makefile b/cmd/ipfs/Makefile index 1d9b305..3c88452 100644 --- a/cmd/ipfs/Makefile +++ b/cmd/ipfs/Makefile @@ -1,7 +1,7 @@ CC = gcc CFLAGS = -O0 LFLAGS = -DEPS = init.h +DEPS = OBJS = init.o main.o ../../commands/argument.o %.o: %.c $(DEPS) diff --git a/commands/Makefile b/commands/Makefile index dbd1c33..17179ee 100644 --- a/commands/Makefile +++ b/commands/Makefile @@ -1,7 +1,7 @@ CC = gcc -CFLAGS = -O0 +CFLAGS = -O0 -I../include -I../../c-libp2p/include LFLAGS = -DEPS = argument.h command.h request.h command_option.h +DEPS = OBJS = argument.o command.o command_option.o %.o: %.c $(DEPS) diff --git a/commands/argument.c b/commands/argument.c index ca9bc56..0e9fc12 100644 --- a/commands/argument.c +++ b/commands/argument.c @@ -1,7 +1,7 @@ #include #include -#include "argument.h" +#include "ipfs/commands/argument.h" int uninit_argument(struct Argument* argument) { return 1; diff --git a/commands/cli/Makefile b/commands/cli/Makefile index 4554582..07eb486 100644 --- a/commands/cli/Makefile +++ b/commands/cli/Makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -O0 +CFLAGS = -O0 -I../../include -I../../../c-libp2p/include LFLAGS = DEPS = parse.h OBJS = parse.o diff --git a/commands/command.c b/commands/command.c index fb84b1b..8b53554 100644 --- a/commands/command.c +++ b/commands/command.c @@ -7,7 +7,7 @@ // #include -#include "command.h" +#include "ipfs/commands/command.h" int init_command(struct Command* cmd) { // allocate memory for Argument array diff --git a/core/Makefile b/core/Makefile index 6d18de9..00f1160 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -O0 +CFLAGS = -O0 -I../include -I../../c-libp2p/include LFLAGS = DEPS = builder.h ipfs_node.h OBJS = builder.o diff --git a/include/ipfs/commands/command.h b/include/ipfs/commands/command.h index a55de72..94ec596 100644 --- a/include/ipfs/commands/command.h +++ b/include/ipfs/commands/command.h @@ -5,8 +5,8 @@ #ifndef __COMMANDS_COMMAND_H__ #define __COMMANDS_COMMAND_H__ -#include "argument.h" -#include "request.h" +#include "ipfs/commands/argument.h" +#include "ipfs/commands/request.h" #include "command_option.h" struct HelpText { diff --git a/include/ipfs/commands/command_option.h b/include/ipfs/commands/command_option.h index 35c7749..fc5048e 100644 --- a/include/ipfs/commands/command_option.h +++ b/include/ipfs/commands/command_option.h @@ -9,6 +9,8 @@ #ifndef __COMMANDS_COMMAND_OPTION_H__ #define __COMMANDS_COMMAND_OPTION_H__ +#include + enum Kind { invalid, boolean, integer, unsignedInt, decimal, str }; struct CommandOption { diff --git a/commands/request.h b/include/ipfs/commands/request.h similarity index 100% rename from commands/request.h rename to include/ipfs/commands/request.h diff --git a/os/Makefile b/os/Makefile index 7d7fcbe..5e4bd59 100644 --- a/os/Makefile +++ b/os/Makefile @@ -1,7 +1,7 @@ CC = gcc -CFLAGS = -O0 +CFLAGS = -O0 -I../include -I../../c-libp2p/include LFLAGS = -DEPS = utils.h +DEPS = OBJS = utils.o %.o: %.c $(DEPS) diff --git a/os/utils.c b/os/utils.c index 9725d2a..727ac2c 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1,4 +1,4 @@ -#include "utils.h" +#include "ipfs/os/utils.h" #include #include diff --git a/repo/Makefile b/repo/Makefile index 0527ec2..3def057 100644 --- a/repo/Makefile +++ b/repo/Makefile @@ -1,6 +1,6 @@ CC = gcc -CFLAGS = -O0 -DEPS = repo.h +CFLAGS = -O0 -I../include -I../../c-libp2p/include +DEPS = OBJS = repo.o %.o: %.c $(DEPS) diff --git a/repo/config/Makefile b/repo/config/Makefile index d0a5cce..3099598 100644 --- a/repo/config/Makefile +++ b/repo/config/Makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -O0 +CFLAGS = -O0 -I../../include -I../../../c-libp2p/include LFLAGS = DEPS = config.h datastore.h identity.h OBJS = config.o diff --git a/repo/config/config.c b/repo/config/config.c index 8afde8c..6919603 100644 --- a/repo/config/config.c +++ b/repo/config/config.c @@ -10,7 +10,7 @@ #include #include -#include "config.h" +#include "ipfs/repo/config/config.h" #include "ipfs/os/utils.h" #include "ipfs/repo/config/bootstrap_peers.h" #include "ipfs/repo/config/swarm.h" diff --git a/repo/fsrepo/Makefile b/repo/fsrepo/Makefile index cfa445b..3d67a82 100644 --- a/repo/fsrepo/Makefile +++ b/repo/fsrepo/Makefile @@ -1,7 +1,7 @@ CC = gcc -CFLAGS = -O0 +CFLAGS = -O0 -I../../include -I../../../c-libp2p/include LFLAGS = -DEPS = fs_repo.h +DEPS = OBJS = fs_repo.o %.o: %.c $(DEPS) diff --git a/repo/fsrepo/fs_repo.c b/repo/fsrepo/fs_repo.c index 0111090..73d4154 100644 --- a/repo/fsrepo/fs_repo.c +++ b/repo/fsrepo/fs_repo.c @@ -6,7 +6,7 @@ // Copyright © 2016 JMJAtlanta. All rights reserved. // -#include "fs_repo.h" +#include "ipfs/repo/fsrepo/fs_repo.h" #include "ipfs/os/utils.h" /** * private methods @@ -222,7 +222,7 @@ int fs_repo_init(char* path, struct RepoConfig* config) { return 0; // TODO: Implement this method - retVal = fs_repo_defaultds_init(path, config); + //retVal = fs_repo_defaultds_init(path, config); if (retVal == 0) return 0; diff --git a/test/Makefile b/test/Makefile index 31be1fa..55f8750 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,10 +1,13 @@ CC = gcc -CFLAGS = -O0 -LFLAGS = -DEPS = testit.h repo/test_repo.h cmd/ipfs/test_init.h +CFLAGS = -O0 -I../include -I../../c-libp2p/include -g3 +LFLAGS = -L../../c-libp2p -lp2p +DEPS = OBJS = testit.o ../cmd/ipfs/init.o ../commands/argument.o ../commands/command_option.o \ ../commands/command.o ../commands/cli/parse.o ../core/builder.o ../repo/fsrepo/fs_repo.o \ - ../repo/fsrepo/fs_repo.o ../repo//config/config.o ../os/utils.o + ../repo/fsrepo/fs_repo.o ../repo//config/config.o ../os/utils.o ../repo/config/identity.o \ + ../repo/config/bootstrap_peers.o ../repo/config/datastore.o ../repo/config/gateway.o \ + ../repo/config/addresses.o ../repo/config/swarm.o ../repo/config/peer.o \ + ../thirdparty/ipfsaddr/ipfs_addr.o %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) diff --git a/thirdparty/Makefile b/thirdparty/Makefile new file mode 100644 index 0000000..3d1665a --- /dev/null +++ b/thirdparty/Makefile @@ -0,0 +1,6 @@ +all: + cd ipfsaddr; make all; + +clean: + cd ipfsaddr; make clean; + \ No newline at end of file diff --git a/thirdparty/ipfsaddr/Makefile b/thirdparty/ipfsaddr/Makefile new file mode 100644 index 0000000..30fd759 --- /dev/null +++ b/thirdparty/ipfsaddr/Makefile @@ -0,0 +1,13 @@ +CC = gcc +CFLAGS = -O0 -I../../include -I../../../c-libp2p/include +LFLAGS = +DEPS = +OBJS = ipfsaddr.o + +%.o: %.c $(DEPS) + $(CC) -c -o $@ $< $(CFLAGS) + +all: $(OBJS) + +clean: + rm -f *.o