-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
62 lines (40 loc) · 973 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
# Makefile
#
include mak/general.mak
SRC_DIR = src
SRC_PMDDIR = $(SRC_DIR)/pmdwin
CFLAGS += -I$(SRC_DIR)
CFLAGS += -I$(SRC_PMDDIR)
SDL_CONFIG = sdl2-config
SDL_LIBS = `$(SDL_CONFIG) --libs`
SDL_CFLAGS = `$(SDL_CONFIG) --cflags`
#
# definations for packing
#
TITLE = pmdmini
TARGET = pmdplay
FILES = Makefile Makefile.lib $(TITLE).txt
FILES += sdlplay.c
FILES_ORG = inherits
LIB = lib$(TITLE).a
MAK_DIR = mak
ZIPSRC = $(TITLE)`date +"%y%m%d"`.zip
TOUCH = touch -t `date +"%m%d0000"`
OBJS = sdlplay.o $(LIB)
all : $(TARGET)
$(TARGET) : $(OBJS)
$(LD) $(LFLAGS) -o $@ $(OBJS) $(SDL_LIBS)
$(LIB):
make -f Makefile.lib
%.o : %.c
$(CC) -o $@ $< -c $(CFLAGS) $(SDL_CFLAGS)
clean :
make -f Makefile.lib clean
rm -f $(TARGET) $(OBJS)
dist :
find . -name ".DS_Store" -exec rm -f {} \;
find $(FILES) $(SRC_DIR) -exec $(TOUCH) {} \;
find $(MAK_DIR) -exec $(TOUCH) {} \;
rm -f $(ZIPSRC)
zip -r $(ZIPSRC) $(MAK_DIR) $(SRC_DIR) $(FILES) $(FILES_ORG)