Skip to content

Commit

Permalink
Using fbconfig/fbmake for libfbjs and jsxmin
Browse files Browse the repository at this point in the history
Summary: 1. move applications from libfbjs to fbjstools directory;
         2. create fbconfg/fbmake TARGETS files for libfbjs and fbjstools;

         Fbconfig/fbmake's handling of flex/bison files are limited, the
         make rule for generated files does not include original directory
         in the path. To keep old libfbjs/Makefile working, I have to add a
         workaround, passing NOT_FBMAKE to g++. A simple fix in fbconfig
         should fix this issue by including the original directory in the
         include path.

Reviewed By: marcel

Test Plan: Tested fbconfig/fbmake both dbg|opt and run all JS tests.

Revert: OK

DiffCamp Revision: 75837
  • Loading branch information
Feng Qian committed Nov 21, 2009
1 parent 5a7d0e6 commit 5f3a8ee
Show file tree
Hide file tree
Showing 49 changed files with 55 additions and 4,935 deletions.
31 changes: 7 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# @author Marcel Laverdet

CPPFLAGS=-fPIC -Wall
CPPFLAGS=-fPIC -Wall -DNOT_FBMAKE=1

ifdef OPT
CPPFLAGS += -O2
Expand All @@ -29,12 +29,12 @@ all: libfbjs.so
install:
cp libfbjs.so /usr/lib64/libfbjs.so

parser.lex.cpp: parser.l
flex -o$@ -d $<
parser.lex.cpp: parser.ll
flex -o $@ -d $<

parser.lex.hpp: parser.lex.cpp

parser.yacc.cpp: parser.y
parser.yacc.cpp: parser.yy
bison --debug --verbose -d -o $@ $<

parser.yacc.hpp: parser.yacc.cpp
Expand All @@ -60,30 +60,13 @@ libfbjs.a: parser.yacc.o parser.lex.o parser.o node.o dmg_fp_dtoa.o dmg_fp_g_fmt
$(AR) rc $@ $^
$(AR) -s $@

libfbjs.so: libfbjs.a fbjs.o
libfbjs.so: libfbjs.a
$(CC) -fPIC -shared $^ -o $@

fbjs: cli.cpp fbjs.cpp libfbjs.a
$(CXX) -ggdb -Wall $^ -o $@

troy: troy.cpp libfbjs.a
$(CXX) -ggdb -Wall $^ -o $@

jsintlparse: jsintlparse.cpp libfbjs.a
$(CXX) -ggdb -Wall $^ -o $@

jsbeautify: jsbeautify.cpp libfbjs.a
$(CXX) -ggdb -Wall $^ -o $@

jsexports: jsexports.cpp libfbjs.a
$(CXX) -ggdb -Wall $^ -o $@

jsxmin: jsxmin_main.cpp jsxmin_renaming.cpp jsxmin_reduction.cpp gflags/gflags.cc gflags/gflags_reporting.cc libfbjs.a
$(CXX) $(CPPFLAGS) -Wall -I. $^ -o $@ -lpthread

clean:
$(RM) -f fbjs troy jsbeautify jsexports \
$(RM) -f \
parser.lex.cpp parser.yacc.cpp parser.yacc.hpp parser.yacc.output \
libfbjs.so libfbjs.a \
dmg_fp_dtoa.o dmg_fp_g_fmt.o \
parser.lex.o parser.yacc.o parser.o node.o fbjs.o
parser.lex.o parser.yacc.o parser.o node.o
22 changes: 22 additions & 0 deletions TARGETS
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cpp_library(
name = 'libfbjs',
srcs = ['parser.ll',
'parser.yy',
'node.cpp',
'parser.cpp',
],
deps = [ ':libfbjs_support' ],
)

cpp_library(
name = 'libfbjs_support',
srcs = ['dmg_fp_dtoa.c',
'dmg_fp_g_fmt.c',
],
known_warnings = ['dmg_fp_dtoa.c', 'dmg_fp_g_fmt.c'],
preprocessor_flags = ['-DIEEE_8087=1',
'-DNO_HEX_FP=1',
'-DLong=int32_t',
'-DULong=uint32_t',
'-include stdint.h'],
)
17 changes: 0 additions & 17 deletions abstract_compiler_pass.h

This file was deleted.

6 changes: 0 additions & 6 deletions bugs/numbers.js

This file was deleted.

4 changes: 0 additions & 4 deletions bugs/statement_func.js

This file was deleted.

3 changes: 0 additions & 3 deletions bugs/unicode.js

This file was deleted.

43 changes: 0 additions & 43 deletions cli.cpp

This file was deleted.

Loading

0 comments on commit 5f3a8ee

Please sign in to comment.