forked from scanoss/minr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (30 loc) · 953 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
CWD=$(shell pwd)
CC=gcc
# Enable all compiler warnings.
CCFLAGS=-g -Wall -std=gnu99 -I./inc -I./external/inc -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
# Linker flags
LDFLAGS= -lz -lldb -lpthread -lcrypto -ldl
BUILD_DIR =build
SOURCES=$(wildcard src/*.c) $(wildcard src/**/*.c) $(wildcard external/*.c) $(wildcard external/**/*.c)
SOURCES_MINR=$(filter-out src/mz_main.c, $(SOURCES))
OBJECTS_MIRN=$(SOURCES_MINR:.c=.o)
SOURCES_MZ=$(filter-out src/main.c, $(SOURCES))
OBJECTS_MZ=$(SOURCES_MZ:.c=.o)
TARGET_MINR=minr
TARGET_MZ=mz
all: clean $(TARGET_MINR) $(TARGET_MZ) clean_build
$(TARGET_MINR): $(OBJECTS_MIRN)
$(CC) -g -o $@ $^ $(LDFLAGS)
$(TARGET_MZ): $(OBJECTS_MZ)
$(CC) -g -o $@ $^ $(LDFLAGS)
.PHONY: minr
%.o: %.c
$(CC) $(CCFLAGS) -o $@ -c $<
clean_build:
rm -f src/*.o src/**/*.o
clean:
rm -f src/*.o src/**/*.o $(TARGET_MINR)
rm -f src/*.o src/**/*.o $(TARGET_MZ)
install:
cp $(TARGET_MINR) /usr/bin
cp $(TARGET_MZ) /usr/bin