-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
64 lines (50 loc) · 2.12 KB
/
Copy pathmakefile
File metadata and controls
64 lines (50 loc) · 2.12 KB
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
62
63
64
# MAKEFILE FOR ALLEG4EVER
TARGET = liballegro4ever
TARGETLIB = allegro4ever
LIBS = -lm -lSDL2 -lSDL2_ttf
LIBSO = -lm -l
CC = gcc
CFLAGS = -w -Wall -Wno-comment -Wno-reorder -fpermissive -DALLEGRO_GCC -DALLEGRO_4_EVER -fpic
INCLUDE_PATH = -I include/ -I include/allegro/platform -I SDL2/include/
.PHONY: default all clean
default: all
all: $(TARGET).a examples
SRC_FILES := $(wildcard src/*.c*)
OBJ_FILES := $(SRC_FILES:.c=.o)
$(TARGET).a: $(OBJ_FILES)
ar rcs $@ $^
%.o: %.c
$(CC) $(INCLUDE_PATH) $(CFLAGS) -c $< -o $@
%.o: %.cpp
$(CC) $(INCLUDE_PATH) $(CFLAGS) -c $< -o $@
exhello.exe: examples/exhello.c $(TARGET).a
$(CC) $(INCLUDE_PATH) $< -o $@ -L. -l$(TARGETLIB) -LSDL2mingw/ $(LIBS)
@echo "Moving executable into examples folder..."
@mv exhello.exe examples/exhello.exe 2>/dev/null || true
exhello_orig.exe: examples/exhello.c
$(CC) $(INCLUDE_PATH) $< -o $@ -L. -lalleg44 $(LIBS)
@echo "Moving executable into examples folder..."
@mv exhello_orig.exe examples/exhello_orig.exe 2>/dev/null || true
exkeys.exe: examples/exkeys.c $(TARGET).a
$(CC) -g $(INCLUDE_PATH) $< -o $@ -L. -l$(TARGETLIB) -LSDL2mingw/ $(LIBS)
@echo "Moving executable into examples folder..."
@mv exkeys.exe examples/exkeys.exe 2>/dev/null || true
examples_orig: $(patsubst examples/%.c, examples/%_orig.exe, $(wildcard examples/*.c))
examples/%_orig.exe: examples/%.c $(TARGET).a
$(CC) $(INCLUDE_PATH) $< -o $@ -L. -lalleg44 -lm
# List of all example .c files
EXAMPLES_SRC := $(wildcard examples/*.c)
# File to exclude
# Current goal is to not support Allegro 3D and packfiles
EXCLUDE_SRC := examples/excamera.c examples/exzbuf.c
# Filtered list of example .c files
EXAMPLES_SRC_FILTERED := $(filter-out $(EXCLUDE_SRC), $(EXAMPLES_SRC))
# List of example executables to create
EXAMPLES := $(patsubst examples/%.c, examples/%.exe, $(EXAMPLES_SRC_FILTERED))
#examples: $(patsubst examples/%.c, examples/%.exe, $(wildcard examples/*.c))
examples: $(EXAMPLES)
examples/%.exe: examples/%.c $(TARGET).a
$(CC) $(INCLUDE_PATH) $< -o $@ -L. -l$(TARGETLIB) -LSDL2mingw/ $(LIBS)
clean:
rm -f $(OBJ_FILES) $(TARGET).a exhello.exe
rm -f $(OBJ_FILES) $(TARGET).a examples/*.exe