-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from kobenairb/makefile_tmx2sne
Optimize tmx2sne makefile
- Loading branch information
Showing
2 changed files
with
17 additions
and
25 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,48 +1,40 @@ | ||
VERSION = "1.0.0" | ||
VERSION := "1.0.0" | ||
DATESTRING := $(shell date +%Y%m%d) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# options for code generation | ||
#--------------------------------------------------------------------------------- | ||
CC=gcc | ||
CFLAGS=-g -O2 -Wall -Wno-implicit-function-declaration -Wno-unused-result -D__BUILD_DATE="\"`date +'%Y%m%d'`\"" -D__BUILD_VERSION="\"$(VERSION)\"" | ||
CC ?= gcc | ||
CFLAGS := -g -O2 -Wall -Wno-implicit-function-declaration -Wno-unused-result -D__BUILD_DATE="\"`date +'%Y%m%d'`\"" -D__BUILD_VERSION="\"$(VERSION)\"" | ||
|
||
SOURCES=tmx2snes.c | ||
OBJS=tmx2snes.o | ||
SOURCES := $(wildcard *.c) | ||
OBJS := $(SOURCES:%.c=%.o) | ||
EXE=tmx2snes | ||
DEFINES= | ||
LIBS= | ||
|
||
ifeq ($(OS),Windows_NT) | ||
EXT=.exe | ||
# CFLAGS += -D__HAS_STRUPR | ||
else | ||
EXT= | ||
endif | ||
|
||
# We want to build the project with static libraries except for Mac OS because the manual page of gcc explain: | ||
# "The static option will not work on Mac OS X unless all libraries (including libgcc.a) have also been compiled with -static. | ||
# We want to build the project with static libraries except | ||
# for Mac OS because the manual page of gcc explain: | ||
# "The static option will not work on Mac OS X unless | ||
# all libraries (including libgcc.a) have also been compiled with -static. | ||
# Since neither a static version of libSystem.dylib nor crt0.o are provided, this option is not useful to most people." | ||
ifneq ($(shell uname -s),Darwin) | ||
CFLAGS+=-static | ||
CFLAGS+=-static | ||
endif | ||
|
||
|
||
|
||
#--------------------------------------------------------------------------------- | ||
all: $(EXE)$(EXT) | ||
|
||
#--------------------------------------------------------------------------------- | ||
$(EXE)$(EXT) : $(OBJS) | ||
@echo make exe $(notdir $<) | ||
@echo "Linking $@" | ||
$(CC) $(CFLAGS) $(OBJS) -o $@ | ||
|
||
tmx2snes.o : tmx2snes.c | ||
@echo make obj $(notdir $<) | ||
%.o : %.c | ||
@echo "Compiling $<" | ||
$(CC) $(CFLAGS) -c $< | ||
|
||
#--------------------------------------------------------------------------------- | ||
clean: | ||
rm -f *.tds $(EXE)$(EXT) $(OBJS) | ||
@rm -f $(EXE)$(EXT) $(OBJS) | ||
|
||
install: | ||
cp $(EXE)$(EXT) ../../devkitsnes/tools/$(EXE)$(EXT) | ||
@cp $(EXE)$(EXT) ../../devkitsnes/tools/$(EXE)$(EXT) |
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