Added Makefile
This commit is contained in:
parent
22c5301461
commit
02702e30f3
2
.replit
2
.replit
|
@ -1,2 +1,2 @@
|
|||
language = "cpp"
|
||||
run = "g++ src/*.cpp -o out -std=c++11; ./out; rm out"
|
||||
run = "make; ./compress; rm compress"
|
20
Makefile
Normal file
20
Makefile
Normal file
|
@ -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)
|
5
src/huffman.d
Normal file
5
src/huffman.d
Normal file
|
@ -0,0 +1,5 @@
|
|||
src/huffman.o: src/huffman.cpp src/huffman.h src/common.h
|
||||
|
||||
src/huffman.h:
|
||||
|
||||
src/common.h:
|
BIN
src/huffman.o
Normal file
BIN
src/huffman.o
Normal file
Binary file not shown.
5
src/main.d
Normal file
5
src/main.d
Normal file
|
@ -0,0 +1,5 @@
|
|||
src/main.o: src/main.cpp src/common.h src/huffman.h
|
||||
|
||||
src/common.h:
|
||||
|
||||
src/huffman.h:
|
BIN
src/main.o
Normal file
BIN
src/main.o
Normal file
Binary file not shown.
Loading…
Reference in a new issue