diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a367b5f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 2.8) + +project(mediafire-tools) + +set(mf-sources account.c cfile.c cmd_auth.c cmd_chdir.c cmd_debug.c cmd_file.c cmd_get.c cmd_help.c cmd_host.c cmd_lcd.c cmd_links.c cmd_list.c cmd_lpwd.c cmd_mkdir.c cmd_pwd.c cmd_whoami.c console.c download.c file.c file_info.c file_links.c folder.c folder_create.c folder_info.c json.c keys.c list.c mfshell.c signals.c signature.c strings.c stringv.c user_session.c) +set(mf-headers account.h cfile.h chdir.h command.h console.h download.h file_info.h file_links.h folder_create.h folder_info.h json.h list.h macros.h mfshell.h private.h signals.h strings.h stringv.h user_session.h) + +add_library(mf-obj OBJECT ${mf-sources} ${mf-headers}) + +add_executable(mfshell main.c $) +target_link_libraries(mfshell curl ssl crypto jansson) diff --git a/Makefile b/Makefile deleted file mode 100644 index e920a92..0000000 --- a/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -CFLAGS = --std=c99 -DEFS = -D_REENTRANT -D_GNU_SOURCE -LIBS = -lcurl -lssl -lcrypto -ljansson -PREFIX = /usr/local - -HOSTARCH = $(shell arch) - -ifeq ($(HOSTARCH),x86_64) -LIB_ARCH = lib64 -else -LIB_ARCH = lib -endif - -makefile: all - -all: mfshell - -mfshell: - gcc $(CFLAGS) $(DEFS) -o mfshell *.c $(LIBS) - -clean: - rm -f *.o - rm -f *.so - rm -f mfshell - -install: - cp -f mfshell ${PREFIX}/bin - chmod 755 ${PREFIX}/bin/mfshell - -