-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (37 loc) · 1.03 KB
/
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
44
45
46
47
48
49
MAKEFILE = Makefile
CC = gcc
CFLAGS = -c -Wall -O1
LDFLAGS =
AR = ar
ARFLAGS = rvs
ifeq ($(DEBUG), 1)
CFLAGS += -g
endif
INCLUDES = -I./include
INCLUDES += $(shell pkg-config --cflags libmodplug)
LIBS = $(shell pkg-config --libs libmodplug)
SRC = ./src/modplugw.c
HEADERS = ./include/modplugw.h
OBJ = ./obj/modplugw.o
OBJ_DYN = ./obj/modplugw.dyn.o
LIBNAME = libmodplugw
LIBFILE = ./lib/$(LIBNAME).a
ifeq ($(OS),Windows_NT)
DLLFILE = ./lib/$(LIBNAME).dll
else
DLLFILE = ./lib/$(LIBNAME).so
endif
LIBFILE_DYN = $(DLLFILE).a
all: $(LIBFILE) $(LIBFILE_DYN)
$(LIBFILE): $(OBJ)
$(AR) $(ARFLAGS) $(LIBFILE) $(OBJ)
$(LIBFILE_DYN): $(OBJ_DYN)
$(CC) -shared $(OBJ_DYN) -o $(DLLFILE) $(LIBS) -Wl,--out-implib,$(LIBFILE_DYN)
$(OBJ): $(SRC) $(HEADERS) $(MAKEFILE)
$(CC) $(CFLAGS) $(INCLUDES) $(SRC) -o $(OBJ)
$(OBJ_DYN): $(SRC) $(HEADERS) $(MAKEFILE)
$(CC) $(CFLAGS) -DMODPLUGW_DYNAMIC $(INCLUDES) $(SRC) -o $(OBJ_DYN)
clean:
rm -f $(OBJ) $(OBJ_DYN) $(LIBFILE) $(LIBFILE_DYN) $(DLLFILE)
install:
@echo 'make install' not implemented!