-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor makefile, add mingw makefile
- Loading branch information
Showing
4 changed files
with
61 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
LOGFILE.TXT | ||
stderr.txt | ||
soulfu | ||
soulfu.exe | ||
source/soulfu.o | ||
*.sdf | ||
*.RUN | ||
SAVELOG.TXT | ||
SAVE*.DAT | ||
CONFIG.DAT | ||
*.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,19 @@ | ||
.PHONY: all clean pack | ||
.PHONY: all clean | ||
|
||
SDP = sdp/sdp | ||
SLC = slc/slc | ||
SSC = ssc/ssc | ||
PKG ?= pkg-config | ||
|
||
TARGET = soulfu | ||
DATAFILE = datafile.sdf | ||
DATADIR = datadir | ||
SRC = source/soulfu.c | ||
OBJ = $(SRC:.c=.o) | ||
LIB = -lm -lSDL -lSDL_net -lGL -logg -ljpeg -lvorbis | ||
FLAGS = -m32 -g | ||
DEP = $(wildcard source/*.c source/*.h) | ||
LDLIBS = -lm $(shell $(PKG) --libs sdl SDL_net ogg libjpeg vorbis gl) | ||
FLAGS = -m32 -DDEVTOOL | ||
|
||
ifdef DEVTOOL | ||
FLAGS += -DDEVTOOL | ||
endif | ||
|
||
all: $(TARGET) $(DATAFILE) | ||
all: $(TARGET) data | ||
|
||
clean: | ||
rm -rf $(TARGET) $(OBJ) $(DATAFILE) | ||
|
||
pack: $(DATAFILE) | ||
|
||
$(DATAFILE): | $(DATADIR) $(SDP) | ||
$(SSC) -c -i $(DATADIR) | ||
$(SDP) -p -n -i $(DATADIR) -o $(DATAFILE) | ||
|
||
$(SDP): | sdp | ||
make -C sdp | ||
|
||
$(SLC): | slc | ||
make -C slc | ||
|
||
$(SSC): | ssc | ||
make -C ssc | ||
rm -rf $(TARGET) $(DATAFILE) | ||
|
||
$(TARGET): $(OBJ) | ||
gcc $(FLAGS) -o $@ -Isource $(LIB) $(OBJ) | ||
$(TARGET): $(DEP) | ||
$(CC) $(FLAGS) -o $@ -Isource $(SRC) $(LDLIBS) | ||
|
||
%.o: %.c | ||
gcc $(FLAGS) -c -o $@ -Isource $(LIB) $< | ||
include common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.PHONY: all clean | ||
|
||
PKG = i686-w64-mingw32-pkg-config | ||
CC = i686-w64-mingw32-gcc | ||
|
||
TARGET = soulfu | ||
SRC = source/soulfu.c | ||
DEP = $(wildcard source/*.c source/*.h) | ||
LDLIBS = $(shell $(PKG) --libs sdl SDL_net ogg libjpeg vorbis) -lopengl32 | ||
FLAGS = -DDEVTOOL | ||
|
||
all: $(TARGET) data | ||
|
||
clean: | ||
rm -rf $(TARGET) $(DATAFILE) | ||
|
||
$(TARGET): $(DEP) | ||
$(CC) $(FLAGS) -o $@ -Isource $(SRC) $(LDLIBS) | ||
|
||
include common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.PHONY: data | ||
|
||
SDP = sdp/sdp | ||
SLC = slc/slc | ||
SSC = ssc/ssc | ||
|
||
DATAFILE = datafile.sdf | ||
DATADIR = datadir | ||
# do not pack RUN files | ||
DATAEXT = DAT DDD JPG LAN MUS OGG PCX SRC SRF TXT | ||
DATADEP = $(foreach ext,$(DATAEXT),$(wildcard $(DATADIR)/*.$(ext))) | ||
|
||
data: $(DATAFILE) | ||
|
||
# TBD: ssc should compile only things that changed since last build | ||
$(DATAFILE): $(DATADEP) | $(DATADIR) $(SSC) $(SDP) | ||
$(SSC) -c -i $(DATADIR) | ||
$(SDP) -p -n -i $(DATADIR) -o $(DATAFILE) | ||
|
||
$(SDP): | sdp | ||
make -C sdp | ||
|
||
$(SLC): | slc | ||
make -C slc | ||
|
||
$(SSC): | ssc | ||
make -C ssc |