mirror of
https://github.com/a0rtega/pafish
synced 2024-11-25 15:49:36 +03:00
Merge pull request #6 from espenfjo/master
Add Makefile for cross compiling on Linux
This commit is contained in:
commit
3ade0a8ade
2
pafish/.gitignore
vendored
Normal file
2
pafish/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
Objects
|
||||
Output
|
36
pafish/Makefile
Normal file
36
pafish/Makefile
Normal file
@ -0,0 +1,36 @@
|
||||
CC = i686-pc-mingw32-gcc
|
||||
WINDRES = i686-pc-mingw32-windres
|
||||
OBJDIR = Objects/MingW
|
||||
SRC = $(wildcard *.c)
|
||||
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/pafish_private.res
|
||||
BIN = Output/MingW/pafish.exe
|
||||
LINKOBJ = $(OBJDIR)/*.o $(OBJDIR)/pafish_private.res
|
||||
LIBS = -s
|
||||
CXXFLAGS = -fexpensive-optimizations -O1 -static-libgcc
|
||||
CFLAGS = -fexpensive-optimizations -O1
|
||||
GPROF = i686-pc-mingw32-gprof
|
||||
LINKFLAGS = -static-libgcc
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
RM = del /Q
|
||||
FixPath = $(subst /,\,$1)
|
||||
else
|
||||
RM = rm -f
|
||||
FixPath = $1
|
||||
endif
|
||||
LINK = i686-pc-mingw32-g++
|
||||
|
||||
.PHONY: all all-before all-after clean clean-custom
|
||||
all: all-before $(BIN) all-after
|
||||
|
||||
clean: clean-custom
|
||||
$(RM) $(call FixPath,$(LINKOBJ)) $(call FixPath,$(BIN))
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
$(CC) $(LINKFLAGS) $(LINKOBJ) -o $@ $(LIBS)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
$(CC) $(CFLAGS) $(DIRS) -c $^ -o $@
|
||||
|
||||
$(OBJDIR)/pafish_private.res: $(OBJDIR)/pafish_private.rc
|
||||
$(WINDRES) --input-format=rc -o $(OBJDIR)/pafish_private.res $(OBJDIR)/pafish_private.rc -O coff
|
Loading…
Reference in New Issue
Block a user