From b8671a325fbb27dd3b1af54dbd8991742890c682 Mon Sep 17 00:00:00 2001 From: Xerbo Date: Tue, 28 Jul 2020 12:58:06 +0100 Subject: [PATCH] Move source into src/ --- CMakeLists.txt | 5 +++-- Makefile | 20 ++++++++++---------- color.c => src/color.c | 0 common.h => src/common.h | 0 dsp.c => src/dsp.c | 0 filter.c => src/filter.c | 0 filter.h => src/filter.h | 0 filtercoeff.h => src/filtercoeff.h | 0 image.c => src/image.c | 0 main.c => src/main.c | 0 median.c => src/median.c | 0 offsets.h => src/offsets.h | 0 pngio.c => src/pngio.c | 0 reg.c => src/reg.c | 0 satcal.h => src/satcal.h | 0 15 files changed, 13 insertions(+), 12 deletions(-) rename color.c => src/color.c (100%) rename common.h => src/common.h (100%) rename dsp.c => src/dsp.c (100%) rename filter.c => src/filter.c (100%) rename filter.h => src/filter.h (100%) rename filtercoeff.h => src/filtercoeff.h (100%) rename image.c => src/image.c (100%) rename main.c => src/main.c (100%) rename median.c => src/median.c (100%) rename offsets.h => src/offsets.h (100%) rename pngio.c => src/pngio.c (100%) rename reg.c => src/reg.c (100%) rename satcal.h => src/satcal.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c1e3bd..9eb7f68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") project (aptdec) -add_executable(aptdec main.c color.c dsp.c filter.c image.c median.c pngio.c reg.c) +file(GLOB_RECURSE C_SOURCE_FILES src/*.c) +add_executable(aptdec ${C_SOURCE_FILES}) # Math target_link_libraries(aptdec PRIVATE m) @@ -18,4 +19,4 @@ target_link_libraries(aptdec PRIVATE PNG::PNG) # SndFile find_package(LibSndFile REQUIRED) -target_link_libraries(aptdec PRIVATE ${LIBSNDFILE_LIBRARY}) \ No newline at end of file +target_link_libraries(aptdec PRIVATE ${LIBSNDFILE_LIBRARY}) diff --git a/Makefile b/Makefile index a35d8e4..4374ac7 100644 --- a/Makefile +++ b/Makefile @@ -2,22 +2,22 @@ CC = gcc BIN = /usr/bin INCLUDES = -I. CFLAGS = -O3 -g -Wall -Wextra -Wno-missing-field-initializers $(INCLUDES) -OBJS = main.o image.o dsp.o filter.o reg.o pngio.o median.o color.o +OBJS = src/main.o src/image.o src/dsp.o src/filter.o src/reg.o src/pngio.o src/median.o src/color.o aptdec: $(OBJS) $(CC) -o $@ $(OBJS) -lm -lsndfile -lpng -reg.o: reg.c -color.o: color.c -main.o: main.c -media.o: median.c -dsp.o: dsp.c -filter.o: filter.c -image.o: image.c -pngio.o: pngio.c +reg.o: src/reg.c +color.o: src/color.c +main.o: src/main.c +media.o: src/median.c +dsp.o: src/dsp.c +filter.o: src/filter.c +image.o: src/image.c +pngio.o: src/pngio.c clean: - rm -f *.o aptdec + rm -f src/*.o aptdec install: install -m 755 aptdec $(BIN) diff --git a/color.c b/src/color.c similarity index 100% rename from color.c rename to src/color.c diff --git a/common.h b/src/common.h similarity index 100% rename from common.h rename to src/common.h diff --git a/dsp.c b/src/dsp.c similarity index 100% rename from dsp.c rename to src/dsp.c diff --git a/filter.c b/src/filter.c similarity index 100% rename from filter.c rename to src/filter.c diff --git a/filter.h b/src/filter.h similarity index 100% rename from filter.h rename to src/filter.h diff --git a/filtercoeff.h b/src/filtercoeff.h similarity index 100% rename from filtercoeff.h rename to src/filtercoeff.h diff --git a/image.c b/src/image.c similarity index 100% rename from image.c rename to src/image.c diff --git a/main.c b/src/main.c similarity index 100% rename from main.c rename to src/main.c diff --git a/median.c b/src/median.c similarity index 100% rename from median.c rename to src/median.c diff --git a/offsets.h b/src/offsets.h similarity index 100% rename from offsets.h rename to src/offsets.h diff --git a/pngio.c b/src/pngio.c similarity index 100% rename from pngio.c rename to src/pngio.c diff --git a/reg.c b/src/reg.c similarity index 100% rename from reg.c rename to src/reg.c diff --git a/satcal.h b/src/satcal.h similarity index 100% rename from satcal.h rename to src/satcal.h