Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Makefile for compile on Mac OS X. #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
# For MacPorts iconv PREFIX=/opt/local
# Set on command if necessary
# make PREFIX=/opt/local

CC = gcc
CFLAGS = -Wall -D_FILE_OFFSET_BITS=64
LDLIBS = -lm

ifdef PREFIX
CFLAGS += -I$(PREFIX)/include
LDLIBS += -L$(PREFIX)/lib
endif

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LDLIBS += -liconv
endif

GIMGLIB_SOURCES = gimglib.c util.c sf_typ.c sf_mps.c sf_tre.c sf_rgn.c sf_lbl.c sf_net.c sf_nod.c sf_dem.c sf_mar.c sf_gmp.c
GIMGLIB_OBJS = $(GIMGLIB_SOURCES:.c=.o)

all: gimginfo gimgfixcmd gimgxor gimgunlock gimgch gimgextract cmdc

gimginfo: gimginfo.o $(GIMGLIB_OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)

gimgfixcmd: gimgfixcmd.o cmdlib.o $(GIMGLIB_OBJS)
$(CC) -o $@ $^ -lm
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)

gimgxor: gimgxor.o

Expand All @@ -19,7 +36,7 @@ gimgch: gimgch.o util_indep.o
gimgextract: gimgextract.o util_indep.o

cmdc: cmdc.o
$(CC) -o $@ $< -lm
$(CC) $(CFLAGS) -o $@ $< $(LDLIBS)

.PHONY: clean
clean:
Expand Down