aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2020-05-25 01:46:09 +0000
committerrepl.it user2020-05-25 01:46:09 +0000
commit02702e30f3be09d07b7dc3cdf6cffaa50026164f (patch)
tree6df95a59819723d2d6f6759842720f4af0c32f0c
parent22c5301461758eca4618fe28e7c4f0dcd26f5238 (diff)
Added Makefile
-rw-r--r--.replit2
-rw-r--r--Makefile20
-rw-r--r--src/huffman.d5
-rw-r--r--src/huffman.obin0 -> 145104 bytes
-rw-r--r--src/main.d5
-rw-r--r--src/main.obin0 -> 274424 bytes
6 files changed, 31 insertions, 1 deletions
diff --git a/.replit b/.replit
index 264b0de..ab94f40 100644
--- a/.replit
+++ b/.replit
@@ -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
new file mode 100644
index 0000000..65709f0
--- /dev/null
+++ b/src/huffman.o
Binary files differ
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
new file mode 100644
index 0000000..09b706f
--- /dev/null
+++ b/src/main.o
Binary files differ