SHOW:
|
|
- or go back to the newest paste.
1 | - | OBJS = src/chat.c src/draw.c src/config.c src/gui.c src/cJSON.c src/text.c src/squirrel.c src/eventcmd.c src/fnmatch.c |
1 | + | # This one is untested, but it roughly matches the structure I use in my NES makefiles |
2 | - | OBJ_NAME = chat |
2 | + | |
3 | - | all : $(OBJS) |
3 | + | objlist := chat draw config gui cJSON text squirrel eventcmd fnmatch |
4 | - | g++ $(OBJS) src/spark.res -w -Wall -Wl,-subsystem,windows -std=gnu99 -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_net -lSDL2_ttf -lsquirrel -lsqstdlib -o $(OBJ_NAME) |
4 | + | program_title = chat |
5 | ||
6 | CC := gcc | |
7 | LD := gcc | |
8 | CFLAGS := -Wall -Wextra -std=gnu99 | |
9 | LDFLAGS := -Wl,-subsystem,windows | |
10 | LDLIBS := -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_net -lSDL2_ttf -lsquirrel -lsqstdlib | |
11 | objdir := obj/win32 | |
12 | srcdir := src | |
13 | objlisto := $(foreach o,$(objlist),$(objdir)/$(o).o) | |
14 | ||
15 | .PHONY: clean | |
16 | ||
17 | program_title: $(objlisto) src/spark.res | |
18 | $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) | |
19 | ||
20 | $(objdir)/%.o: $(srcdir)/%.c | |
21 | $(CC) $(CFLAGS) $< -o $@ | |
22 | ||
23 | clean: | |
24 | -rm $(objdir)/*.o |