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

Created check for MACOSX with __MACH__ #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
131 changes: 50 additions & 81 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,81 +1,50 @@
#############################################################
# TO BE CHANGED BY EACH USER TO POINT TO include/ AND lib/
# DIRS HOLDING CFITSIO *.h AND libcfitsio IF THEY ARE NOT IN
# THE STANDARD PLACES
#

CFITSIOINCDIR = ../../cfitsio/include
LIBDIR = ../../cfitsio/lib

#
#
#############################################################
# COMPILATION OPTIONS BELOW
#

# another good memory checker is valgrind : http://valgrind.kde.org/index.html
# valgrind --tool=memcheck hotpants

# for memory checking with libefence
# LIBS = -L$(LIBDIR) -lm -lcfitsio -lefence

# for profiling with gprof
# COPTS = -pg -fprofile-arcs -funroll-loops -O3 -ansi -pedantic-errors -Wall -I$(CFITSIOINCDIR)

# for gdbugging
#COPTS = -g3 -funroll-loops -O3 -ansi -pedantic-errors -Wall -I$(CFITSIOINCDIR)

# standard usage
# recently added -std=c99 after a bug report
COPTS = -funroll-loops -O3 -ansi -std=c99 -pedantic-errors -Wall -I$(CFITSIOINCDIR) -D_GNU_SOURCE
LIBS = -L$(LIBDIR) -lm -lcfitsio

# compiler
CC = gcc

#
#
#############################################################
# BELOW SHOULD BE OK, UNLESS YOU WANT TO COPY THE EXECUTABLES
# SOMEPLACE AFTER THEY ARE BUILT eg. hotpants
#

STDH = functions.h globals.h defaults.h
ALL = main.o vargs.o alard.o functions.o

all: hotpants extractkern maskim

hotpants: $(ALL)
$(CC) $(ALL) -o hotpants $(LIBS) $(COPTS)
# cp hotpants ../../bin/$(ARCH)

main.o: $(STDH) main.c
$(CC) $(COPTS) -c main.c

alard.o: $(STDH) alard.c
$(CC) $(COPTS) -c alard.c

functions.o: $(STDH) functions.c
$(CC) $(COPTS) -c functions.c

vargs.o: $(STDH) vargs.c
$(CC) $(COPTS) -c vargs.c

extractkern : extractkern.o
$(CC) extractkern.o -o extractkern $(LIBS) $(COPTS)

extractkern.o : $(STDH) extractkern.c
$(CC) $(COPTS) -c extractkern.c

maskim : maskim.o
$(CC) maskim.o -o maskim $(LIBS) $(COPTS)

maskim.o: $(STDH) maskim.c
$(CC) $(COPTS) -c maskim.c

clean :
rm -f *.o
rm -f *~ .*~
rm -f hotpants
rm -f extractkern
rm -f maskim
CFITSIOINCDIR = /usr/local/include

#use only with no debugging
COPTS = -funroll-loops -O3 -ansi -Wall -I$(CFITSIOINCDIR) -I/usr/include/malloc
LIBS = -lm -lcfitsio

CC = gcc

STDH = functions.h globals.h defaults.h
ALL = main.o vargs.o alard.o functions.o
SWIG = alard.o functions.o
ALLT = main_test.o vargs.o alard.o functions.o

all: hotpants

hotpants: $(ALL)
$(CC) $(ALL) -o hotpants $(LIBS) $(COPTS)

hotpants_test: $(ALLT)
$(CC) $(ALLT) -o hotpants_test $(LIBS) $(COPTS)

main_test.o: $(STDH) main_test.c
$(CC) $(COPTS) -c main_test.c

main.o: $(STDH) main.c
$(CC) $(COPTS) -c main.c

alard.o: $(STDH) alard.c
$(CC) $(COPTS) -c alard.c

functions.o: $(STDH) functions.c
$(CC) $(COPTS) -c functions.c

vargs.o: $(STDH) vargs.c
$(CC) $(COPTS) -c vargs.c

NCOPTS = -funroll-loops -O3 -I$(CFITSIOINCDIR) -I/usr/include/malloc

extractkern : extractkern.c
$(CC) $(NCOPTS) extractkern.c -o extractkern $(LIBS)

maskim : maskim.c
$(CC) $(NCOPTS) maskim.c -o maskim $(LIBS)

clean :
rm -f *.o
rm -f *~ .*~
rm -f hotpants
rm -f extractkern
rm -f maskim
9 changes: 8 additions & 1 deletion alard.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<malloc.h>

#if !defined(__MACH__)
#include <malloc.h>
#endif
#if defined(__MACH__)
#include <stdlib.h>
#endif

#include<stdlib.h>
#include<fitsio.h>

Expand Down
9 changes: 8 additions & 1 deletion extractkern.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
#include<string.h>
#include<strings.h>
#include<math.h>
#include<malloc.h>

#if !defined(__MACH__)
#include <malloc.h>
#endif
#if defined(__MACH__)
#include <stdlib.h>
#endif

#include<stdlib.h>
#include<fitsio.h>

Expand Down
9 changes: 8 additions & 1 deletion extractkernOnes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
#include<string.h>
#include<strings.h>
#include<math.h>
#include<malloc.h>

#if !defined(__MACH__)
#include <malloc.h>
#endif
#if defined(__MACH__)
#include <stdlib.h>
#endif

#include<stdlib.h>
#include<fitsio.h>

Expand Down
9 changes: 8 additions & 1 deletion functions.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<malloc.h>

#if !defined(__MACH__)
#include <malloc.h>
#endif
#if defined(__MACH__)
#include <stdlib.h>
#endif

#include<stdlib.h>
#include<fitsio.h>
#include<ctype.h>
Expand Down
9 changes: 8 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<malloc.h>

#if !defined(__MACH__)
#include <malloc.h>
#endif
#if defined(__MACH__)
#include <stdlib.h>
#endif

#include<stdlib.h>
#include<fitsio.h>
#include<ctype.h>
Expand Down
9 changes: 8 additions & 1 deletion maskim.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
#include<string.h>
#include<strings.h>
#include<math.h>
#include<malloc.h>

#if !defined(__MACH__)
#include <malloc.h>
#endif
#if defined(__MACH__)
#include <stdlib.h>
#endif

#include<stdlib.h>
#include<fitsio.h>

Expand Down