-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.win32
45 lines (35 loc) · 1.04 KB
/
Makefile.win32
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
44
45
CFLAGS=-g -Wall -Wextra -DNDEBUG -D_WIN32 $(OPTFLAGS)
CXXFLAGS=-g -Wall -Wextra -DNDEBUG -D_WIN32 $(OPTFLAGS)
LIBS=$(OPTLIBS)
PREFIX?=/usr/local
#CC=i586-mingw32msvc-g++
SOURCES=$(wildcard src/*.cpp)
OBJECTS=$(patsubst %.cpp,%.o,$(SOURCES))
TEST_SRC=$(wildcard tests/*_tests.cpp)
TESTS=$(patsubst %.cpp,%,$(TEST_SRC))
TARGET=build/ccmix.exe
SO_TARGET=$(patsubst %.a,%.so,$(TARGET))
# The Target Build
all: $(TARGET)
dev: CXXFLAGS=-g -Wall -Isrc -Wall -Wexta $(OPTFLAGS)
dev: all
$(TARGET): build $(OBJECTS)
$(CC) $(OBJECTS) -o $(TARGET)
build:
@mkdir -p build
@mkdir -p bin
# The Cleaner
clean:
rm -rf build $(OBJECTS) $(TESTS)
rm -f tests/tests.log
find . -name "*.gc*" -exec rm {} \;
rm -rf `find . -name "*.dSYM" -print`
# The Install
install: all
install -d $(DESTDIR)/$(PREFIX)/lib/
install $(TARGET) $(DESTDIR)/$(PREFIX)/lib/
# The Checker
BADFUNCS='[^_.>a-zA-Z0-9](str(n?cpy|n?cat|xfrm|n?dup|str|pbrk|tok|_)|stpn?cpy|a?sn?printf|byte_)'
check:
@echo Files with potentially dangerous functions.
@egrep $(BADFUNCS) $(SOURCES) || true