Skip to content

Commit

Permalink
move to a makefile in prep for binary releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Clark committed Mar 12, 2014
1 parent 1e435a0 commit a49106c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
*.exe
*.out
*.app

dist
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
OPTS := -DDO_COUNT -DTEXT_REPLY -DREAD_FILE -DREAD_GIF -DNULLSERV_REPLIES -DSSL_RESP
TEST_OPTS := -DTEST -DVERBOSE
TINY_OPTS := -O3 -DTINY
DEBUG_OPT := -DHEX_DUMP
CC := gcc
CFLAGS += -Os -s -Wall -ffunction-sections -fdata-sections -fno-strict-aliasing
LDFLAGS += -Wl,--gc-sections
STRIP := strip -s -R .note -R .comment -R .gnu.version -R .gnu.version_r
CROSSCC := mipsel-uclibc-gcc
CROSSSTRIP:= mipsel-uclibc-$(STRIP)
SRC = pixelserv.c

# mips uclib toolchain
export PATH := /opt/brcm/hndtools-mipsel-uclibc/bin:/opt/brcm/hndtools-mipsel-linux/bin:$(PATH)

all: dist mips tiny host32 host64
@echo "Builds in dist folder."

dist:
@mkdir dist

mips:
$(CROSSCC) -mips32 $(CFLAGS) $(LDFLAGS) $(OPTS) $(SRC) -o dist/pixelserv.mips32
$(CROSSSTRIP) dist/pixelserv.mips32

host32:
$(CC) -m32 $(CFLAGS) $(LDFLAGS) $(OPTS) $(SRC) -o dist/pixelserv.x86
$(STRIP) dist/pixelserv.x86

host64:
$(CC) -m64 $(CFLAGS) $(LDFLAGS) $(OPTS) $(SRC) -o dist/pixelserv.amd64
$(STRIP) dist/pixelserv.amd64

tiny:
$(CROSSCC) -mips32 $(CFLAGS) $(LDFLAGS) $(TINY_OPTS) $(SRC) -o dist/pixelserv.tiny.mips32
$(CROSSSTRIP) dist/pixelserv.tiny.mips32
34 changes: 0 additions & 34 deletions build.sh

This file was deleted.

0 comments on commit a49106c

Please sign in to comment.