Skip to content

Commit

Permalink
Split core/include.am into per-subdirectory include.am files
Browse files Browse the repository at this point in the history
Closes ticket 32137.
  • Loading branch information
nmathewson committed Jan 13, 2020
1 parent 5888db4 commit 73ac1ad
Show file tree
Hide file tree
Showing 26 changed files with 611 additions and 457 deletions.
4 changes: 4 additions & 0 deletions changes/ticket32137
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
o Code simplification and refactoring:
- Our include.am files are now broken up by subdirectory. Previously,
src/core/include.am covered all of the subdirectories in "core",
"feature", and "app". Closes ticket 32137.
7 changes: 2 additions & 5 deletions scripts/maint/add_c_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,9 @@ def get_include_am_location(fname):
not (yet) consistent.
"""
td = topdir_file(fname)
m = re.match(r'^lib/([a-z0-9_]*)/', td)
m = re.match(r'^(lib|core|feature|app)/([a-z0-9_]*)/', td)
if m:
return "src/lib/{}/include.am".format(m.group(1))

if re.match(r'^(core|feature|app)/', td):
return "src/core/include.am"
return "src/{}/{}/include.am".format(m.group(1),m.group(2))

if re.match(r'^test/', td):
return "src/test/include.am"
Expand Down
21 changes: 21 additions & 0 deletions src/app/config/include.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# ADD_C_FILE: INSERT SOURCES HERE.
LIBTOR_APP_A_SOURCES += \
src/app/config/config.c \
src/app/config/quiet_level.c \
src/app/config/statefile.c

# ADD_C_FILE: INSERT HEADERS HERE.
noinst_HEADERS += \
src/app/config/config.h \
src/app/config/or_options_st.h \
src/app/config/or_state_st.h \
src/app/config/quiet_level.h \
src/app/config/statefile.h \
src/app/config/tor_cmdline_mode.h


noinst_HEADERS += \
src/app/config/auth_dirs.inc \
src/app/config/fallback_dirs.inc \
src/app/config/testnet.inc
18 changes: 18 additions & 0 deletions src/app/main/include.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# ADD_C_FILE: INSERT SOURCES HERE.
LIBTOR_APP_A_SOURCES += \
src/app/main/main.c \
src/app/main/shutdown.c \
src/app/main/subsystem_list.c \
src/app/main/subsysmgr.c

# ADD_C_FILE: INSERT HEADERS HERE.
noinst_HEADERS += \
src/app/main/main.h \
src/app/main/ntmain.h \
src/app/main/shutdown.h \
src/app/main/subsysmgr.h

if BUILD_NT_SERVICES
LIBTOR_APP_A_SOURCES += src/app/main/ntmain.c
endif
18 changes: 18 additions & 0 deletions src/core/crypto/include.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# ADD_C_FILE: INSERT SOURCES HERE.
LIBTOR_APP_A_SOURCES += \
src/core/crypto/hs_ntor.c \
src/core/crypto/onion_crypto.c \
src/core/crypto/onion_fast.c \
src/core/crypto/onion_ntor.c \
src/core/crypto/onion_tap.c \
src/core/crypto/relay_crypto.c

# ADD_C_FILE: INSERT HEADERS HERE.
noinst_HEADERS += \
src/core/crypto/hs_ntor.h \
src/core/crypto/onion_crypto.h \
src/core/crypto/onion_fast.h \
src/core/crypto/onion_ntor.h \
src/core/crypto/onion_tap.h \
src/core/crypto/relay_crypto.h
Loading

0 comments on commit 73ac1ad

Please sign in to comment.