-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (43 loc) · 893 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
PREFIX = i586-pc-msdosdjgpp-
CC = $(PREFIX)gcc
AR = $(PREFIX)ar
RANLIB = $(PREFIX)ranlib
CFLAGS = -Wall -g
SRC = src
RM = rm -rf
CP = cp
MKDIR_P = mkdir -p
BIN_DIR = bin
BIN_NAME = bin/test.exe
LIB_DIR = lib
LIB_NAME = lib/libabsu.a
OBJS = block.o \
bitmap.o \
draw.o \
logger.o \
loop.o \
keyboard.o \
video.o
all: $(LIB_NAME) $(BIN_NAME) testdata
.PHONY: testdata clean $(LIB_NAME) directories
directories:
$(MKDIR_P) $(BIN_DIR)
$(MKDIR_P) $(LIB_DIR)
%.o: $(SRC)/%.s
$(CC) -c -o $@ $< $(CFLAGS)
%.o: $(SRC)/%.c
$(CC) -c -o $@ $< $(CFLAGS)
$(LIB_NAME): $(OBJS) directories
$(AR) rc $(LIB_NAME) $(OBJS)
$(RANLIB) $(LIB_NAME)
$(BIN_NAME): $(OBJS)
$(CC) -Wall -g -Ivendor/jdas209f test/test.c $(OBJS) \
vendor/jdas209f/judaslib.a \
-o $(BIN_NAME)
clean:
$(RM) *.o
$(RM) $(BIN_DIR)
$(RM) $(LIB_DIR)
testdata:
$(CP) test/test.bmp bin
$(CP) vendor/jdas209f/*.wav bin