diff options
author | Anthony Wang | 2020-05-25 01:46:09 +0000 |
---|---|---|
committer | repl.it user | 2020-05-25 01:46:09 +0000 |
commit | 02702e30f3be09d07b7dc3cdf6cffaa50026164f (patch) | |
tree | 6df95a59819723d2d6f6759842720f4af0c32f0c | |
parent | 22c5301461758eca4618fe28e7c4f0dcd26f5238 (diff) |
Added Makefile
-rw-r--r-- | .replit | 2 | ||||
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | src/huffman.d | 5 | ||||
-rw-r--r-- | src/huffman.o | bin | 0 -> 145104 bytes | |||
-rw-r--r-- | src/main.d | 5 | ||||
-rw-r--r-- | src/main.o | bin | 0 -> 274424 bytes |
6 files changed, 31 insertions, 1 deletions
@@ -1,2 +1,2 @@ language = "cpp" -run = "g++ src/*.cpp -o out -std=c++11; ./out; rm out"
\ No newline at end of file +run = "make; ./compress; rm compress"
\ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..da6af72 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +TARGET ?= compress +SRC_DIRS ?= ./src + +SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s) +OBJS := $(addsuffix .o,$(basename $(SRCS))) +DEPS := $(OBJS:.o=.d) + +INC_DIRS := $(shell find $(SRC_DIRS) -type d) +INC_FLAGS := $(addprefix -I,$(INC_DIRS)) + +CPPFLAGS ?= $(INC_FLAGS) -MMD -MP -std=c++11 + +$(TARGET): $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o $@ $(LOADLIBES) $(LDLIBS) + +.PHONY: clean +clean: + $(RM) $(TARGET) $(OBJS) $(DEPS) + +-include $(DEPS) diff --git a/src/huffman.d b/src/huffman.d new file mode 100644 index 0000000..390b68f --- /dev/null +++ b/src/huffman.d @@ -0,0 +1,5 @@ +src/huffman.o: src/huffman.cpp src/huffman.h src/common.h + +src/huffman.h: + +src/common.h: diff --git a/src/huffman.o b/src/huffman.o Binary files differnew file mode 100644 index 0000000..65709f0 --- /dev/null +++ b/src/huffman.o diff --git a/src/main.d b/src/main.d new file mode 100644 index 0000000..7ae82ce --- /dev/null +++ b/src/main.d @@ -0,0 +1,5 @@ +src/main.o: src/main.cpp src/common.h src/huffman.h + +src/common.h: + +src/huffman.h: diff --git a/src/main.o b/src/main.o Binary files differnew file mode 100644 index 0000000..09b706f --- /dev/null +++ b/src/main.o |