-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (27 loc) · 960 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
MODULES =
PROGRAMS = SampleUsage
#DEFDIR = def
#MODDIR = mod
#OBJDIR = obj
OBJDIR = .
#EXTRADEFDIR = ../m2-raylib
EXTRALINK = -lraylib /home/nbrk/Downloads/devel/raygui/raygui.so
#EXTRALINK = $(OBJDIR)/libraylib.so.4.5.0
GM2 = gm2-14
GM2FLAGS = -fsoft-check-all -fiso -g -O2 -Wall -I$(DEFDIR) -I$(EXTRADEFDIR)
MODULES_DEF = $(addprefix $(DEFDIR)/, $(MODULES:=.def))
MODULES_MOD = $(addprefix $(MODDIR)/, $(MODULES:=.mod))
MODULES_OBJ = $(addprefix $(OBJDIR)/, $(MODULES:=.o))
PROGRAMS_BIN = $(addprefix $(OBJDIR)/, $(PROGRAMS:=.bin))
#all: modules programs
all: $(MODULES_OBJ) $(PROGRAMS_BIN)
#modules: $(addprefix $(OBJDIR)/, $(MODULES:=.o))
#programs: $(addprefix $(OBJDIR)/, $(PROGRAMS:=.bin))
$(OBJDIR)/%.o: $(MODDIR)/%.mod $(DEFDIR)/%.def
$(GM2) $(GM2FLAGS) -c -o $@ $<
$(OBJDIR)/%.bin: %.mod $(MODULES_DEF) $(MODULES_OBJ)
$(GM2) $(GM2FLAGS) -o $@ $(MODULES_OBJ) $< $(EXTRALINK)
clean:
rm -f *.o
rm -f $(OBJDIR)/*.o
rm -f $(OBJDIR)/*.bin