From 589ae39a47fc4be3630d3560984f2d5faad4f19f Mon Sep 17 00:00:00 2001 From: Joker2770 <1214220480@qq.com> Date: Thu, 19 Nov 2020 10:08:07 +0800 Subject: [PATCH] add cmake to compile. --- .gitignore | 1 + Makefile | 8 ++++---- {include => src}/morse.h | 0 3 files changed, 5 insertions(+), 4 deletions(-) rename {include => src}/morse.h (100%) diff --git a/.gitignore b/.gitignore index 6323394..e89b189 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ x64/ x86/ bld/ [Bb]in/ +[Bb]uild/ [Oo]bj/ [Ll]og/ diff --git a/Makefile b/Makefile index 837e18d..20b57b3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ cc = gcc prom = morse-encode-and-decode -CFLAGS=-I ./include -deps = $(shell find ./include -name "*.h") +deps = $(shell find ./src -name "*.h") src = $(shell find ./src -name "*.c") obj = $(src:%.c=%.o) @@ -9,10 +8,11 @@ $(prom): $(obj) $(cc) -o $(prom) $(obj) %.o: %.c $(deps) - $(cc) $(CFLAGS) -Wall -g -fPIC -shared -o $@ -c $< + $(cc) -Wall -g -fPIC -shared -o $@ -c $< clean: rm -rf $(obj) $(prom) install: - cp $(prom) /usr/local/bin \ No newline at end of file + cp $(prom) /usr/local/bin + diff --git a/include/morse.h b/src/morse.h similarity index 100% rename from include/morse.h rename to src/morse.h