-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
25 lines (18 loc) · 855 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CC=gcc
CXX=g++
CFLAGS+=-Wall -Wextra -Iinclude/ -Og
CXXFLAGS+=-Wall -Wextra -Iinclude/ -std=c++17 -Og
LDFLAGS+=-Llib/ -lQmageDecoder -lm -fuse-ld=lld
BUILD_DIR=bin
all: build
build: $(BUILD_DIR)/qmdecoder
$(BUILD_DIR)/%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
$(BUILD_DIR)/%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
$(BUILD_DIR)/qmdecoder: $(BUILD_DIR)/qmdecoder.o $(BUILD_DIR)/qmage_helper.o $(BUILD_DIR)/io_helper.o $(BUILD_DIR)/image_helper.o $(BUILD_DIR)/image_writer.o $(BUILD_DIR)/msf_gif.o
$(CXX) -o $@ $^ $(LDFLAGS)
run: $(BUILD_DIR)/qmdecoder
cd ${BUILD_DIR} && LD_LIBRARY_PATH="../lib/:${LD_LIBRARY_PATH}" ./qmdecoder ../examples/bootsamsung.qmg
clean:
rm -f ${BUILD_DIR}/qmdecoder.o $(BUILD_DIR)/qmage_helper.o $(BUILD_DIR)/io_helper.o $(BUILD_DIR)/image_helper.o $(BUILD_DIR)/image_writer.o $(BUILD_DIR)/msf_gif.o ${BUILD_DIR}/qmdecoder