Skip to content

Commit d0b1698

Browse files
Added Java code formatting which should be enabled using options
1 parent cf9cd23 commit d0b1698

29 files changed

Lines changed: 21768 additions & 0 deletions

astyle/build/mac/Makefile

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# Make file for GCC compiler on Mac OS X
2+
# The license.html file describes the conditions under which this software may be distributed.
3+
4+
# to test on Linux use "make linux=1"
5+
6+
# list of source files
7+
SRC = astyle_main.cpp \
8+
ASBeautifier.cpp \
9+
ASFormatter.cpp \
10+
ASEnhancer.cpp \
11+
ASLocalizer.cpp \
12+
ASResource.cpp
13+
14+
# source directories
15+
vpath %.cpp ../../src
16+
vpath %.h ../../src
17+
18+
# NOTE for java compiles the environment variable $JAVA_HOME must be set
19+
# example: export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.00
20+
ifndef JAVA_HOME
21+
JAVA_HOME = /usr/lib/jvm/default-java
22+
endif
23+
24+
# set prefix if not defined on the command line
25+
ifndef prefix
26+
prefix=/usr
27+
endif
28+
SYSCONF_PATH=$(prefix)/share/doc/astyle
29+
# the path was changed in release 2.01
30+
# SYSCONF_PATH_OLD may be removed at the appropriate time
31+
SYSCONF_PATH_OLD=$(prefix)/share/astyle
32+
33+
# define macros
34+
dylib = dylib
35+
dynamiclib = -dynamiclib
36+
bindir = bin
37+
objdir = obj
38+
ipath=$(prefix)/bin
39+
CBASEFLAGS = -W -Wall -fno-rtti -fno-exceptions
40+
JAVAINCS = -I$(JAVA_HOME)/include
41+
CXX = g++
42+
INSTALL=install -o $(USER) -g $(USER)
43+
# INSTALL=install -o 0 -g 0
44+
45+
# for testing on linux
46+
ifdef linux
47+
dylib = so
48+
dynamiclib = -shared
49+
endif
50+
51+
##################################################
52+
53+
# define compile options for each build
54+
ifdef CFLAGS
55+
CFLAGSr = -DNDEBUG $(CBASEFLAGS) $(CFLAGS)
56+
CFLAGSd = -g $(CBASEFLAGS) $(CFLAGS)
57+
else
58+
CFLAGSr = -DNDEBUG -O3 $(CBASEFLAGS)
59+
CFLAGSd = -g $(CBASEFLAGS)
60+
endif
61+
CFLAGSs = -DASTYLE_LIB -fPIC $(CFLAGSr)
62+
CFLAGSsd = -DASTYLE_LIB -fPIC $(CFLAGSd)
63+
CFLAGSa = -DASTYLE_LIB $(CFLAGSr)
64+
CFLAGSad = -DASTYLE_LIB $(CFLAGSd)
65+
CFLAGSsj = -DASTYLE_JNI -fPIC $(CFLAGSr) $(JAVAINCS)
66+
CFLAGSsjd = -DASTYLE_JNI -fPIC $(CFLAGSd) $(JAVAINCS)
67+
68+
# define link options
69+
ifdef LDFLAGS
70+
LDFLAGSr = $(LDFLAGS)
71+
LDFLAGSd = $(LDFLAGS)
72+
endif
73+
74+
# object files are built from the source list $(SRC)
75+
# a suffix is added for each build
76+
OBJ = $(patsubst %.cpp,$(objdir)/%.o,$(SRC))
77+
OBJd = $(patsubst %.cpp,$(objdir)/%_d.o,$(SRC))
78+
OBJs = $(patsubst %.cpp,$(objdir)/%_s.o,$(SRC))
79+
OBJsd = $(patsubst %.cpp,$(objdir)/%_sd.o,$(SRC))
80+
OBJa = $(patsubst %.cpp,$(objdir)/%_a.o,$(SRC))
81+
OBJad = $(patsubst %.cpp,$(objdir)/%_ad.o,$(SRC))
82+
OBJsj = $(patsubst %.cpp,$(objdir)/%_sj.o,$(SRC))
83+
OBJsjd = $(patsubst %.cpp,$(objdir)/%_sjd.o,$(SRC))
84+
85+
# define object file rule (with the suffix) for each build
86+
87+
# OBJ
88+
$(objdir)/%.o: %.cpp astyle.h astyle_main.h
89+
@ mkdir -p $(objdir)
90+
$(CXX) $(CFLAGSr) -c -o $@ $<
91+
92+
# OBJd
93+
$(objdir)/%_d.o: %.cpp astyle.h astyle_main.h
94+
@ mkdir -p $(objdir)
95+
$(CXX) $(CFLAGSd) -c -o $@ $<
96+
97+
# OBJs
98+
$(objdir)/%_s.o: %.cpp astyle.h
99+
@ mkdir -p $(objdir)
100+
$(CXX) $(CFLAGSs) -c -o $@ $<
101+
102+
# OBJsd
103+
$(objdir)/%_sd.o: %.cpp astyle.h
104+
@ mkdir -p $(objdir)
105+
$(CXX) $(CFLAGSsd) -c -o $@ $<
106+
107+
# OBJa
108+
$(objdir)/%_a.o: %.cpp astyle.h
109+
@ mkdir -p $(objdir)
110+
$(CXX) $(CFLAGSa) -c -o $@ $<
111+
112+
# OBJad
113+
$(objdir)/%_ad.o: %.cpp astyle.h
114+
@ mkdir -p $(objdir)
115+
$(CXX) $(CFLAGSad) -c -o $@ $<
116+
117+
# OBJsj
118+
$(objdir)/%_sj.o: %.cpp astyle.h
119+
@ mkdir -p $(objdir)
120+
$(CXX) $(CFLAGSsj) -c -o $@ $<
121+
122+
# OBJsjd
123+
$(objdir)/%_sjd.o: %.cpp astyle.h
124+
@ mkdir -p $(objdir)
125+
$(CXX) $(CFLAGSsjd) -c -o $@ $<
126+
127+
##################################################
128+
# define build dependencies for each command
129+
130+
release: astyle
131+
astyle: $(OBJ)
132+
@ mkdir -p $(bindir)
133+
$(CXX) $(LDFLAGSr) -o $(bindir)/$@ $^
134+
strip $(bindir)/$@
135+
@ echo
136+
137+
debug: astyled
138+
astyled: $(OBJd)
139+
@ mkdir -p $(bindir)
140+
$(CXX) $(LDFLAGSd) -o $(bindir)/$@ $^
141+
@ echo
142+
143+
shared: libastyle.$(dylib)
144+
libastyle.$(dylib): $(OBJs)
145+
@ mkdir -p $(bindir)
146+
$(CXX) $(dynamiclib) $(LDFLAGSr) -o $(bindir)/$@ $^
147+
@ echo
148+
149+
shareddebug: libastyled.$(dylib)
150+
libastyled.$(dylib): $(OBJsd)
151+
@ mkdir -p $(bindir)
152+
$(CXX) $(dynamiclib) $(LDFLAGSd) -o $(bindir)/$@ $^
153+
@ echo
154+
155+
static: libastyle.a
156+
libastyle.a: $(OBJa)
157+
@ mkdir -p $(bindir)
158+
ar crs $(bindir)/$@ $^
159+
@ echo
160+
161+
staticdebug: libastyled.a
162+
libastyled.a: $(OBJad)
163+
@ mkdir -p $(bindir)
164+
ar crs $(bindir)/$@ $^
165+
@ echo
166+
167+
java: libastylej.$(dylib)
168+
libastylej.$(dylib): $(OBJsj)
169+
@ mkdir -p $(bindir)
170+
$(CXX) $(dynamiclib) $(LDFLAGSr) -o $(bindir)/$@ $^
171+
@ echo
172+
173+
javadebug: libastylejd.$(dylib)
174+
libastylejd.$(dylib): $(OBJsjd)
175+
@ mkdir -p $(bindir)
176+
$(CXX) $(dynamiclib) $(LDFLAGSd) -o $(bindir)/$@ $^
177+
@ echo
178+
179+
all: release debug shared shareddebug static staticdebug
180+
181+
javaall: java javadebug
182+
183+
clean:
184+
rm -f $(objdir)/*.o $(bindir)/*astyle*
185+
186+
cleanobj:
187+
rm -f $(objdir)/*.o
188+
189+
install:
190+
$(INSTALL) -m 755 -d $(ipath)
191+
@$(INSTALL) -m 755 $(bindir)/astyle $(ipath)
192+
193+
$(INSTALL) -m 755 -d $(SYSCONF_PATH)
194+
@mkdir -p $(SYSCONF_PATH)/html;
195+
@for files in ../../doc/*.html ../../doc/*.css; \
196+
do \
197+
$(INSTALL) -m 644 $$files $(SYSCONF_PATH)/html; \
198+
done
199+
@if [ -d $(SYSCONF_PATH_OLD) ]; then \
200+
rm -rf $(SYSCONF_PATH_OLD); \
201+
fi
202+
203+
uninstall:
204+
rm -f $(ipath)/astyle
205+
rm -rf $(SYSCONF_PATH)
206+
@if [ -d $(SYSCONF_PATH_OLD) ]; then \
207+
rm -rf $(SYSCONF_PATH_OLD); \
208+
fi

astyle/build/mac/bin/astyle

382 KB
Binary file not shown.
83.7 KB
Binary file not shown.

astyle/build/mac/obj/ASEnhancer.o

18 KB
Binary file not shown.

astyle/build/mac/obj/ASFormatter.o

149 KB
Binary file not shown.

astyle/build/mac/obj/ASLocalizer.o

130 KB
Binary file not shown.

astyle/build/mac/obj/ASResource.o

42.1 KB
Binary file not shown.

astyle/build/mac/obj/astyle_main.o

177 KB
Binary file not shown.

0 commit comments

Comments
 (0)